Why am I getting an infinite loop with have_posts?
Look at this answer: get custom post type by tag I believe you’d use $flagged_stores->the_post() inside while loop.
Look at this answer: get custom post type by tag I believe you’d use $flagged_stores->the_post() inside while loop.
Finally, I solved it myself. Here is the solution: In functions.php: function show_all_children($parent_id, $post_id, $current_level) { $top_parents = array(); $top_parents = get_post_ancestors($post_id); $top_parents[] = $post_id; $children = get_posts( array( ‘post_type’ => ‘page’ , ‘posts_per_page’ => -1 , ‘post_parent’ => $parent_id , ‘order_by’ => ‘title’ , ‘order’ => ‘ASC’ )); if (empty($children)) return; echo ‘<ul class=”children … Read more