Oxygen Builder Advanced Query

Generate a repeater with a preset Advanced Query

The Advanced Query builder present in Oxygen Builder repeaters is a powerful way to display all types of posts, filtering down to exactly what you want. Additionally, there's an added bonus of being able to insert dynamic data from ACF fields, WordPress core, and any PHP function, to really create some powerful queries using a simple GUI.

However, there are 2 main problems with this feature - 1, many don't know how to structure the query they want (they're complicated to begin with!), and 2, once we have the query, it can be tedious to add all of the fields, data, and info to the GUI.

In the past, we've seen many building queries using our WordPress PHP mode, and translating them to Oxygen.

Now, with the Oxygen Builder Advanced Query Mode by CodeWP, you can generate entire Advanced Query repeaters from a single sentence, ready to be imported directly into your project and used in seconds!

All you need to do is prompt for what query you want - ex, "Get all posts by the current author, tagged 'Good Work' ". CodeWP's AI will convert this into a WP_query, and then build out the JSON for a repeater element, ready to be installed on the site.

How To Use

First, enter your prompt and create a generation in the editor.

This will generate a self contained reusable part for Oxygen Builder, in JSON format. To import it, first, create a new reusable part.

Then, under the Oxygen Meta Box, click on JSON, and paste the generation directly into the input.

Publish your reusable part, then open it in Oxygen. Review the Advanced Query to check the formatting and review the logic.

Then, you can add the part to any page you need, using either single or edit mode, depending on your needs.

Snippet Examples

{"id":0,"name":"root","depth":0,"children":[{"id":1,"name":"oxy_dynamic_list","options":{"ct_id":1,"ct_parent":0,"selector":"codewp_advanced_query","original":{"image_type":"2","attachment_size":"full","wp_query":"advanced","wp_query_advanced_preset":"Custom Settings","wp_query_advanced":[{"key":"post_type","values":[{"value":"post"}]},{"key":"meta_key","values":[{"value":"product_price"}]},{"key":"meta_value","values":[{"value":"100"}]},{"key":"tax_query","values":[{"value":"","key":"array","values":[{"value":"brand","key":"taxonomy","values":[]},{"value":"slug","key":"field","values":[]},{"value":"","key":"terms","values":[{"value":"nike"}]}]}]},{"key":"orderby","values":[{"value":"title"}]},{"key":"order","values":[{"value":"ASC"}]}]},"nicename":"CodeWP Advanced Query","ct_depth":1},"children":[{"id":2,"name":"ct_div_block","options":{"ct_id":2,"ct_parent":1,"selector":"codewp_advanced_query-inner","nicename":"CodeWP Advanced Query - Inner","ct_depth":2,"ct_content":"","original":[]},"depth":"2"}],"depth":1}],"meta_keys":[]}
{"id":0,"name":"root","depth":0,"children":[{"id":2,"name":"oxy_dynamic_list","options":{"ct_id":2,"ct_parent":0,"selector":"codewp_advanced_query","original":{"image_type":"2","attachment_size":"full","wp_query":"advanced","wp_query_advanced_preset":"Custom Settings","wp_query_advanced":[{"key":"post_type","values":[{"value":"post"}]},{"key":"author","values":[{"value":"[oxygen data='phpfunction' function='get_current_user_id' ]"}]},{"key":"meta_key","values":[{"value":"featured"}]},{"key":"meta_value","values":[{"value":"1"}]},{"key":"date_query","values":[{"value":"","key":"after","values":[{"value":"July","key":"month","values":[]},{"value":"1st","key":"day","values":[]},{"value":"2020","key":"year","values":[]}]},{"value":"","key":"before","values":[{"value":"July","key":"month","values":[]},{"value":"1st","key":"day","values":[]},{"value":"2021","key":"year","values":[]}]},{"value":"true","key":"inclusive","values":[]}]}]},"nicename":"CodeWP Advanced Query","activeselector":false},"depth":1,"children":[{"id":3,"name":"ct_div_block","options":{"ct_id":3,"ct_parent":2,"selector":"codewp_advanced_query-inner","original":[],"nicename":"CodeWP Advanced Query - Inner","activeselector":false},"depth":2}]}],"meta_keys":["oxygen_lock_post_edit_mode"]}

Prompt Examples

Prompt//: Retrieve all posts by a the current user, that have a specific custom field value of 1 for "featured", and are in a specific date range between July 1st, 2020 and July 1st, 2021.
Prompt//: Retrieve all posts with a custom field product_price equal to 100, custom tax "brand" equal to Nike, ordered by title.

Did you know?

You can easily use any one of these prompt examples in the Code Creator by clicking the "random prompt" icon in the lower right corner of the prompt input.
Launch Mode
Language:
Product:
For:
Pro and Agency Plans