Divi Query Builder

The Divi Query Builder is a powerful tool that simplifies complex database requests and enables website owners to curate their posts for each visitor. With its intuitive visual builder module, you can easily create customized queries for various types of content, including posts, pages, custom types, WordPress users, and taxonomy terms. Our plugin gives Divi users the same power as developers in modifying WordPress queries, making it easier to create a more personalized experience for visitors.
This page covers the documentation of our plugin Divi Query Builder.
Plugin Activation
To download the plugin, visit your Account page and download the zip file. Afterward, navigate to your site dashboard and open the plugins menu page. Click on the sub menu “Add New” and upload the plugin by clicking the “Upload Plugin” button. Once it’s uploaded, activate the plugin, and a new sub-menu called “Divi Coding” will appear under the Plugins menu. On that menu, you can enter the license for our plugin. An active license is only required for automatic updates and to have access to support.
Use Our Divi Module
After uploading and activating our plugin, you will notice a new folder named “Divi Coding” in the list of Divi modules collection. When you open this folder, you will find a module named “Query Builder”. Similar to other Divi modules, you can easily add it to your page by simply clicking on it.
Query Types
In this section, you can select the query type. Currently, supported query types are:
- Post, pages, media & any post type for any query that will retrieve data from post base type like post, pages, project, products…
- Categories, tags & any taxonomy terms for any query that will retrieve data from taxonomy terms like categories, tags, and custom taxonomy terms from any post type.
- Users to retrieve data from your site users.
- Current singular or archive page query to get post data from the main query of your current page or archive. To use it on archive pages place the module on the template you need within the Divi Theme Builder.
Post query arguments
- Number: Maximum number of posts to show.
- Order: Designates the ascending or descending order of the “Order By” argument.
- Order By: Sort retrieved posts by parameter. See WP documentation.
- Post Type: Retrieves posts by post types. See WP documentation. At least one post type is required. If you want to query Media (attachments) post type make sure to change the Post Status to include inherit status.
- Post Status: Retrieves posts by post status. See WP documentation.
Taxonomy query arguments
This section appears only for post query and it is helpful to restrict your query using taxonomy terms like categories, tags, or any custom taxonomy. See WP Documentation.
- Relation: Relation for the taxonomy query. Use AND if you want all conditions to be true to select the post, OR if you only need one condition to be true.
- Taxonomy: The taxonomy you want to use his terms to check again the post terms.
- Operation: Operator to test. Possible values are ‘IN’, ‘NOT IN’, ‘AND’, ‘EXISTS’, and ‘NOT EXISTS’.
- Terms: The terms from the taxonomy selected above you want to check using the operator above.
You can create several groups of taxonomy + operator+ terms, to satisfy the condition you want to show the posts.
Let’s say that for example you want to show posts from the category ‘Blog’ OR posts with tags ‘web development’. For this use case you will select the OR relation, and create two groups of conditions one for categories IN ‘Blog’ and another for tags IN ‘web development’.
Custom fields arguments
This section appears for post/term/user queries and it is helpful to restrict your query using custom field values. See WP Documentation.
- Relation: Relation for the taxonomy query. Use AND if you want all conditions to be true to select the post, OR if you only need one condition to be true.
- Operator: Operator to use to compare the custom field value(s).
- Custom Field Name: Name of the custom field.
- Custom Field Value: Comma separate string of values. These values will be checked using the operator for each post.
You can create several groups of custom field comparisons to satisfy the condition you want to show the posts.
Let’s say that, for example, you want to show posts that have a value ‘hello’ on a custom field called ‘acf_text’ and a value 4 on a custom field called ‘number’. For this use case, you will select the AND relation, and create two groups of conditions one for acf_text EQUAL ‘hello’ and another for number EQUAL 4.
Terms query arguments
- Number: Maximum number of terms to show.
- Order: Designates the ascending or descending order of the “Order By” argument.
- Order By: Sort retrieved terms by parameter. See WP documentation.
- Taxonomy: Select the taxonomies to query terms of.
- Terms: Select the terms you want to include or exclude. Leave empty to query of terms of the taxonomies selected on the option before.
- Include or Exclude Terms: Choose to include or exclude the terms you have selected.
- Hide Empty: Whether to hide terms not assigned to any posts.
User query arguments
- Number: Maximum number of users to show.
- Order: Designates the ascending or descending order of the “Order By” argument.
- Order By: Sort retrieved users by parameter. See WP documentation.
- User Roles: Retrieve users by role.
- Include or Exclude Role:Choose to include or exclude users from the roles you have selected.
Current page arguments
There are no arguments for the current singular or archive page query option. This option is designed for the module to get its data from the current main WordPress query. Whether the module is placed on a singular page to show the page/post data or on an author/date/category archive page to show a grid of related posts.
Other query arguments
In this section, you will find additional query settings that can be applied to one or all query types.
- Ignore Sticky Posts: Do not move sticky posts to the start of the results.
- Post Authors: Show posts associated with these authors. Leave blank to include all authors.
- Include or Exclude Authors: Choose to include or exclude posts from the authors you have selected.
- Post Mime Types: Show posts associated with these mime types. See WP Documentation.
- Search: Search criteria to match posts/terms/users. See WP documentation for post, users, and terms.
Elements
This section of the module options will show you options to control which data of the elements coming from each query type.
Post elements
The following options will show for the post and current page query types.
- Show Feature Image: Show/hide the post feature image.
- Show Title: Show/hide the post title.
- Show Terms: Show/hide the post terms.
- Taxonomy Terms: Select the taxonomy from which you want to show post terms.
- Show Excerpt: Show/hide the post excerpt.
- Show Link: Activate this option to show a link to the post page.
- Link Text: Text for the post page link.
- Link Target: Target for the post page link.
Term elements
- Show Name: Show/hide the term name.
- Show Description: Show/hide the term description.
- Show Archive Page: Activate this option to show a link to the term archive page.
- Archive Page Link Text: Text for the archive page link.
User elements
- Show Avatar: Show/hide the user avatar.
- Show Display Name: Show/hide the user display name.
- Show Bio: Show/hide the user’s biographical information.
- Show Author Page: Activate this option to show the author archive page link.
- Show Website: Show/hide the user website link.
- Show Mail: Show/hide the user’s mail address.
Custom fields elements
The current version supports native custom fields and ACF basic custom fields.
- Show Custom Fields: Show/hide the post/term/user custom fields.
- Custom Fields: Select the custom fields you want to show. You can drag and drop the fields to reorder them.
Layout
Currently, we support the following layouts for the items (CSS Grid, Masonry, Carousel, List, and Fullwidth).
- Layout: Select the layout type.
- Columns: Select the number of columns (grid type only)
- Gaps: Select the space between the columns and below the items.
- List Type: Select the list type between ordered and unordered (list type only).
- Items Width: Minimum width for the items (masonry type only)
- Items Gap: Select the space between the columns and below the items (masonry type only).
- Minify: Preserve the order of items (masonry type only)
- Direction: Select the carousel direction (Left to right, right to left, and top to bottom).
- Type: Select the carousel type between Infinite Loop and Slider.
- Speed: Transitions speed in milliseconds.
- Show Pagination Dots: Show the page controls for the carousel.
- Items Per Page: Select the space between the columns and below the items.
- Show Navigation Arrows: Show the carousel control for the navigation.
- Items Per Move: Select the space between the columns and below the items.
- Auto Mode: Select the auto mode between none, autoplay, and auto-scroll.
- Progress Bar: Show the progress bar.
Other Design Options
There are options to control the font settings of the post, terms and user elements. And the other usual Divi module design settings.
0 Comments