0
I have a config.php file, all the other files on the site include it.
I’m having trouble checking which page config.php is currently running.
Only example I found was using is_page but failed
if(is_page('about')){
echo "estou na pagina about";
}else{
echo "não estou na pagina about";
}
Thank you in advance!
Wordpress ?
– NoobSaibot
That’s right, that function
is_page
has face to be Wordpress. Without it, you can utilize the$_SERVER["REQUEST_URI"]
, that has the URI accessed.– Woss
Worked right buddy
– iPrimePortas
You can put a variable with the page name on all pages, before include config.php, for example: on the about page
$pagina="about";
on the home page$pagina="Home";
etc... Inconfig.php
putsecho "estou na pagina ". $pagina;
– user60252