Custom Query

Customizing Queries for Loop Elements in Breakdance

This document explains how to utilize the custom query option for Loop elements, such as the Post Loop Builder element or Post List element, to dynamically display posts based on specific criteria.

Getting Started with Custom Queries

  1. Add a Loop element to your page, such as the Post Loop Builder element or Post List element.
  2. Navigate to the query option in the properties panel and select “Custom Query”.
  3. Click “Edit Query” to open the query builder pop-up.

Configuring Your Query

Selecting Your Source

There are three different source options available for selection.

  1. Post Type: You can select either a single post type or multiple post types.
  2. Related: Use the related source option to include post types based on taxonomy, including both default WordPress taxonomies and custom taxonomies.
  3. ACF Relationship: For dynamic content based on ACF relationships, select the ACF relationship field to populate your loop.

Adjusting the Amount of Posts Shown

This area allows you to specify how many posts are shown in the loop.

  1. Change the number of posts per page and the total posts to control how many posts show on one page and in the entire query.
  2. Use the offset option to skip a certain number of posts at the beginning of your query.

Filtering Your Content

  1. Apply conditions to filter posts within the loop, such as specifying a taxonomy or filtering by date.
  2. Utilize meta query settings to filter results based on custom field values, including the capability for nested meta queries.

Ordering and Excluding Posts

  1. In the order by section, select how you want to sort your posts, with options including date, title, modified date, comment count, menu order, random, and custom fields from ACF or Meta Box.
  2. Filter posts by date to only include posts from a specific time frame, such as the past day, month, or year.
  3. Choose to ignore the current post in your loop, useful for related posts sections to exclude the post being viewed.

Additional Notes

This guide provides a comprehensive overview of creating custom queries for loop elements in Breakdance, offering flexibility in how content is dynamically displayed. By leveraging these options, you can tailor your site’s content display to meet specific needs and enhance user engagement.