Monday, April 04, 2022
The Great Tit
Updated: 4. 4. 2022, Added: 4. 4. 2022

Display only parent posts with repeater dynamic query in Oxygen builder

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!
Did I help you? Support me on Patreon!
Beep this article to your friends!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram