Condition statements for Widget Logic
-
Hi, I’m using Widget Logic to manage conditional appearance of Widgets in the sidebar.
I have a page structure:
https://www.domain.com/products/prod1/
https://www.domain.com/products/prod1/screenshots
https://www.domain.com/products/prod1/tour
https://www.domain.com/products/prod1/fooprod1’s ID is 602. I want the widget to appear on page 602 and all URLs descendant from page 602. Here’s what I’ve tried:
global $post; return (is_page(602) || $post->post_parent==”602″);
and
global $post; return (is_page(602) || in_array(602,get_post_ancestors($post)));
Neither of these seem to evaluate correctly. The widget is shown on page ID 602, but not on children. What am I doing wrong?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Condition statements for Widget Logic’ is closed to new replies.