Reputation:
Is there a way to create an is_page statement which targets the parent page & also all of the child pages? This is my code so far.. and only works on the parent page.
<?php if( is_page( array( 'view-by-collections') ) ) { ?>
** MY CODE **
<?php } ?>
Upvotes: 0
Views: 3087
Reputation: 776
I suggest you use the ID of the page in question and try something like this:
<?php if (is_page(ID_OF_VIEW_BY_COLLECTIONS) || $post->post_parent == ID_OF_VIEW_BY_COLLECTIONS) { ?>
** Your Code **
<?php } ?>
Upvotes: 2