Is it possible to for loop through a specific parents children in Wordpress?
At the moment I have looked into:
$post->post_parent == '2'
but thats more of an if statement condition. Also I tried the following, but I need a specific parents children.
while(have_posts()) : the_post();
the following article helped me: https://wordpress.org/support/topic/displaying-wp_list_pages-and-custom-fields
You can use a custom query:
$the_query = new WP_Query(array(
'post_parent' => 2
));
while ($the_query->have_posts())
{
$the_query->the_post();
echo get_the_title();
}
wp_reset_postdata();