Dispaly on Page depth count
-
The current code outputs the comments template on the first child of its parent.
$firstChild = get_pages( array( 'child_of' => $post->ID, ) ); if ($firstChild ){ comments_template(); }
This issue I am having is that the first child also has a child and that child may have a child of its own and so on. I only want the template to display on the first child. Not any grandchildren of the top parent. Hope that makes sense. Thanks in advance for any help. I tried using count, but was not able to achieve my goal. Thanks in advance for any help.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Dispaly on Page depth count’ is closed to new replies.