Title: cblock's Replies | WordPress.org

---

# cblock

  [  ](https://wordpress.org/support/users/cblock/)

 *   [Profile](https://wordpress.org/support/users/cblock/)
 *   [Topics Started](https://wordpress.org/support/users/cblock/topics/)
 *   [Replies Created](https://wordpress.org/support/users/cblock/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/cblock/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/cblock/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/cblock/engagements/)
 *   [Favorites](https://wordpress.org/support/users/cblock/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Admin “edit” post content alignment is centered](https://wordpress.org/support/topic/admin-edit-post-content-alignment-is-centered/)
 *  Thread Starter [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/admin-edit-post-content-alignment-is-centered/#post-1198911)
 * thanks esmi….it was a plugin!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [is_page not “completely” working](https://wordpress.org/support/topic/is_page-not-completely-working/)
 *  Thread Starter [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/is_page-not-completely-working/#post-1198223)
 * @ apljdi;
 * correction
 * > …WP is not recognizing the || is_page (‘arts-entertainment’) to be **true**…
 * Yes, you have the right idea, but the arts-entertainment condition returns true
   for all cases except for the || is_page (‘arts-entertainment’) – that’s where
   i test to see if the current page is the “Arts & Entertainment” page; in such
   a case include the nav-ent.php else continue
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [is_page not “completely” working](https://wordpress.org/support/topic/is_page-not-completely-working/)
 *  Thread Starter [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/is_page-not-completely-working/#post-1198167)
 * No replies yet huh?
    Well im not one to stop trying….oddly enough after further
   investigations i found that the following code produced the results i wanted,
   but im sure that this is a sloppy hack.
 * Any one know why this works…from my limited understanding, it would seem to me
   that WP is not recognizing the **|| is_page (‘arts-entertainment’)** to be false.
   as stated before changing the is_page() argument…results true. I tried using 
   the page ID (577) as the argument for is_page(), but still returns false. After
   further testing, i deduced that “somehow?!?” WP thinks that the Arts & Entertainment
   page is a child of the ‘news’ category (13)…thus the following sloppy hack
 * >  if ( in_category(‘news’) || post_is_in_descendant_category( 13 )) {
   >  if ( 
   > is_page(577)){ include ‘includes/nav-ent.php’; } else include ‘includes/nav-
   > home.php’; }
 * was used to replace the first condition in the code from the prev post.
 * You know how coding is sometimes….”just make it work”, even when we know its 
   just a quick fix, hard code hack…just looking for any clarity on this issue.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [if is a page, or a child of a page, or in a category (a solution)](https://wordpress.org/support/topic/if-is-a-page-or-a-child-of-a-page-or-in-a-category-a-solution/)
 *  [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/if-is-a-page-or-a-child-of-a-page-or-in-a-category-a-solution/#post-938178)
 * i am having a similar problem:
    My conditional statement works for all cases 
   except arts-entertainment page. 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.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [is_page not working for “posts” page](https://wordpress.org/support/topic/is_page-not-working-for-posts-page/)
 *  [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/is_page-not-working-for-posts-page/#post-950492)
 * i am having a similar problem:
    My conditional statement works for all cases 
   except arts-entertainment page. 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.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [is_page not working](https://wordpress.org/support/topic/is_page-not-working-1/)
 *  [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/is_page-not-working-1/#post-1057631)
 * i am having a similar problem:
    My conditional statement works for all cases 
   except arts-entertainment page. 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.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [conditional IF ELSE statements not working](https://wordpress.org/support/topic/conditional-if-else-statements-not-working/)
 *  [cblock](https://wordpress.org/support/users/cblock/)
 * (@cblock)
 * [16 years, 11 months ago](https://wordpress.org/support/topic/conditional-if-else-statements-not-working/#post-855321)
 * i am having a similar problem:
    My conditional statement works for all cases 
   except arts-entertainment page. 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.

Viewing 7 replies - 1 through 7 (of 7 total)