How can you display a list of child pages in wordpress?
Answer Posted / Bibin Abraham
To display a list of child pages, you can use the WP_Query function and set 'posts_per_page' to -1. Here is an example: $args = array('parent' => get_the_ID(), 'posts_per_page' => -1); $query = new WP_Query($args); while ($query->have_posts()) : $query->the_post(); the_title(); endwhile; wp_reset_postdata();
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers