subpage conditional statemement not working
-
I need to code the sidebar with a conditional statement so that if you add a new page that is a subpage of page 131 (“what we do”) then the “what we do” sidebar will show.
it’s not working. Any ideas?
‘<?php if ( is_page( ‘what-we-do’ ) || ‘131’ == $post->post_parent ) { ?>
<?php if ( ! dynamic_sidebar(‘What We Do Sidebar’) ) : ?><?php endif; ?>
<?php } else { ?>
<?php if ( ! dynamic_sidebar(‘Main Sidebar’) ) : ?><?php endif; ?>
<?php } ?>’
- The topic ‘subpage conditional statemement not working’ is closed to new replies.