Special Condition with ancestors
-
I am using a condition like this in the page.php file:
<?php $ancestors = get_post_ancestors($post); if (is_page('3')) { include(TEMPLATEPATH . '/content0.php'); } else if (is_page('5') || in_array(5,$ancestors)) { include(TEMPLATEPATH . '/content1.php'); } else { include(TEMPLATEPATH . '/content2.php'); } ?>
The thing is that I am also having pages finishing like this: https://www.mydomainname.com/?page_id=94&category=8&product_id=16 (I am using the wp-ecommerce plugin).
Here, page 94 is child of page 5 but the ‘&category=8&product_id=16’ stuff in the address make this code above inefficient.
Can you help me here?
ps: WordPress4Ever .)
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Special Condition with ancestors’ is closed to new replies.