is_page not “completely” working
-
i am having a problem with my code:
My conditional statement works for all cases except arts-entertainment page. When testing the code i determined that it is the is_page(‘arts-entertainment’) that is not working… When replacing the argument with any page name ie. ‘business’ the code works fine….consider me stumped!!?Below is my code, any help would be appreciated.
===================
<?php
if ( in_category(‘news’) || post_is_in_descendant_category( 13 ) ) {
include ‘includes/nav-home.php’;
}
elseif ( in_category(‘business’) || post_is_in_descendant_category( 14 ) || is_page(‘business’)) {
include ‘includes/nav-bus.php’;
}
elseif ( in_category(‘arts-entertainment’) || post_is_in_descendant_category( 17 ) || is_page(‘arts-entertainment’)) {
include ‘includes/nav-ent.php’;
}
elseif ( in_category(‘living’) || post_is_in_descendant_category( 19 ) || is_page(‘living’)) {
include ‘includes/nav-liv.php’;
}
elseif ( in_category(‘opinion’) || post_is_in_descendant_category( 18 ) || is_page(‘opinion’)) {
include ‘includes/nav-opn.php’;
}
elseif ( in_category(‘sports’) || post_is_in_descendant_category( 20 ) || is_page(‘sports’)) {
include ‘includes/nav-spt.php’;
}
else {
include ‘includes/nav-home.php’;
}
?>==================
FYI: The idea is to use a different color for navigation for each page in the conditional statement.Any help would greatly appreciated!
- The topic ‘is_page not “completely” working’ is closed to new replies.