I
I
Insom842020-04-24 20:44:56
PHP
Insom84, 2020-04-24 20:44:56

If it is on this page?

<?php if (is_front_page() || is_home()) : ?>- checks if you are on the main page, right?
But how to register, so that it checks not the main page of the site, but the specific one on which you are currently located?

I'm trying to remove circular references.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
ProF1NE, 2020-04-24
@ProF1NE

use $_GET['page'] = 'page name'
links https://domain.xyz/index.php?page=about
mask them in htaccess RewriteRules
RewriteRule ^about(/?)+$ index.php?page=about [L]
https://domain.xyz/about
request a page

if(isset($_GET['page']) && $_GET['page'] != '') {
if($_GET['page'] == 'home') {
 echo ('на главной странице');
} elseif($_GET['page'] == 'about') {
 echo ('на странице О нас');
}

}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question