I'm new to WP and search for some examples on $pagenow codes. Everything I saw equals to .php files.

How can I make an if statement that $pagenow is equal to my Home Page or specific page?


The $pagenow variable is specificly meant to identify pages in the admin area. It cannot be used on the frontend of the site.

There is another set of tests to identify pages on the frontend. is_home, for instance, tests whether the current page is the homepage, while is_page('about-us') will test whether you are on the About Us page. There is an overview of these tags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.