Phil
(@owendevelopment)
Where you generated the meta box code (functions file or plugin), maybe try placing it inside (not tested this myself):
function is_tree( $pid ) {
if ( is_page() ) {
return ( get_the_ID() == $pid || in_array( $pid, get_post_ancestors( get_the_ID() ) ) );
}
return false;
}
More info on get_post_ancestors… here.
Thread Starter
obidos
(@obidos)
Hi Phil and thank you for your reply.
I am adding my custom meta within my functions file and here is the bit of code I have to add it to the pages:-
function add_custom_meta()
{
add_meta_box("subpages", "Include page in sub navigation", "get_pages_list", "page", "normal", "default");
}
add_action('add_meta_boxes', 'add_custom_meta');
So it shows on all pages. I just need it on the top level parent pages.
Thanks