how to test for all children (including multilevel grand-childern) of page
You can use get_ancestors() to check if the post have an ancestor parent id or grandparent id etc.. But you would have to check every post for this… function rt_before_after($content) { if(is_page() || is_single()) { global $post; $ancestors = get_ancestors( $post->ID, ‘page’ ); if ( in_array( 27, $ancestors ) || $post->ID == ’27’) { $ntest=”<div … Read more