is_page() needs to meet certain conditions?
-
I can’t get to work my is_page(‘contact’) conditional. It ALWAYS return false.
I’ve put it in the footer.php to show the slide-in contact form on any page OTHER than “Contact” page https://seosumo.com/contact since that page already contains a contact form.
This is my code
<?php if (!is_page(‘Contact’)) {
include(TEMPLATEPATH.’/sideform.php’);
} ?>I’ve tried with the following no success:
-lowercase (as the url shows) ‘contact’
-different if arrangements (if(foo)) :
-page ID instead of name.
-is_page() combined with else instead of !is_page()
-is_page() conditional placed on the page’s template instead of footer.Nothing worked, so my questions are:
1) Does is_page() need the page to show 1 page only? no extra loops? (mine loads blog posts in that page too)2) Does is_page() need to be called from within the loop?
WP version is 2.7.1
Any ideas?
- The topic ‘is_page() needs to meet certain conditions?’ is closed to new replies.