Aleš Sýkora / November 28, 2023 / 0 comments

Display only parent posts with repeater dynamic query in Oxygen builder

Post summary: If you need to display only parent pages or posts, you just need to put post_parent = 0 parameter to your dynamic query in Oxygen builder. So it will work like normal WordPress query:

If you need to display only parent pages or posts, you just need to put post_parent = 0 parameter to your dynamic query in Oxygen builder.

So it will work like normal WordPress query:

$parent_query = new WP_Query(array(
    'post_type' => 'events',
    'post_parent' => 0
));

while ($parent_query->have_posts()){
    $parent_query->the_post();
    // etc...
}

wp_reset_query(); // if you're not in your main loop you need to reset the query!

Fuel my passion for writing with a beer🍺

Your support not only makes me drunk but also greatly motivates me to continue creating content that helps. Cheers to more discoveries and shared success. 🍻

0 comments

Share Your Thoughts