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

How to ignore sticky posts in Oxygen repeater?

Post summary: If you create WordPress query with Oxygen Builder’s repeater element, then you propably want to ignore sticky posts sometimes. This is how you can do that with advanced query builder. You have two options of ignoring sticky posts: Ignore them from display pinned on the top, but display them in results of queryDo not display…

If you create WordPress query with Oxygen Builder’s repeater element, then you propably want to ignore sticky posts sometimes. This is how you can do that with advanced query builder.

You have two options of ignoring sticky posts:

  1. Ignore them from display pinned on the top, but display them in results of query
  2. Do not display them at all

Ignore sticky posts from display pinned on the top, but display them in results of query

Set up your query post_type and add the ignore_sticky_posts with value true.

Advanced query builder in Oxygen with sticky posts ignored.

Hide sticky posts completely

If you don’t want display sticky posts from the query, you need to use post__not_in function.

post__not_in' => get_option("sticky_posts"),

Which in oxygen should be something like:

[oxygen data=”phpfunction” function=”get_option” arguments=”sticky_posts”]

I did not test it yet, but it should be working.

That’s all you need to do for disabling the sticky posts in WordPress query with Oxygen.

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