Can’t get is_page() tag to work in the sidebar
-
On my site I have a static page called ‘archive’, it’s displayed using the archives.php template. There’s a link to this page in the sibedar, and I want to hide this link when a user is on the Archives page.
I tried using both is_page() and is_page_template() conditional tags without any success. I also tried referring to the page by its name and ID, still without success.
Here’s what I’ve tried to put in the sidebar:
<?php if (is_page(64)) { ?>blah-blah<?php } ?>
<?php if (is_page(‘archive’)) { ?>blah-blah<?php } ?>
<?php if (is_page_template(‘archives.php’)) { ?>blah-blah<?php } ?>None of the above displayed in the sidebar on /archive page.
Please can you tell me what am I doing wrong?
- The topic ‘Can’t get is_page() tag to work in the sidebar’ is closed to new replies.