Logo
Logo

Array Query

Utilizing the Array Query in Breakdance Loop Elements

This article briefly explains the process of using the array query feature within loop elements to create advanced content queries. This method leverages PHP for dynamic content display customization.

Setting Up Your Loop Element

Adding a Loop Element to Your Page

  1. Begin by adding a loop element to your page, such as the post loop builder or the post list element.
  2. Navigate to the query option in the properties panel of your selected loop element.
  3. Select “Array” query option and then click the expand icon to open up the query editor.

Creating Advanced Queries with Array Query

Using the PHP Editor for Custom Queries

Click the expand icon to open the PHP editor. Within the editor, you can enter PHP functions and custom code or utilize WordPress classes to craft the query. This powerful feature allows for a wide range of query customizations beyond standard options.

You can learn more about queries in WordPress through the WordPress Developer Document for WP_Query

While the Breakdance Support team cannot help create these queries, here are some Array Query examples that may be useful:

Handling Errors in Your Query

If you encounter a 500 error when using the query editor, this typically indicates a syntax or logical error within your PHP query. Review and correct the query to resolve the issue and refresh the query to see the corrected output.

Additional Notes

The array query feature in Breakdance offers an advanced method for customizing the content displayed within loop elements. By directly manipulating query parameters through PHP, users can achieve highly tailored content displays that meet specific site requirements. Always ensure to double-check your PHP syntax and logic to prevent errors and ensure smooth functionality.