5th Feb '24
/
10 comments

Nav Menus Custom Query Types in Bricks

Updated on 21 Aug 2024

This Pro tutorial shows how custom query types for each navigation menu can be generated in Bricks.

This enables us to loop through the menu items of any nav menu and visually build menu items' titles/text linked to their URLs with optional descriptions.

Use case: When a footer from a design set like Frames is imported, delete all but the first list item, enable query loop on it, and select the nav menu from the query type dropdown to make the static items dynamic.

Note: All items of the selected menu will appear at the same level regardless of their hierarchy/depth in the menu. If hierarchy is to be maintained with indentation, you may want to use a Nav Menu element instead of this approach.

Step 1

Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Upcoming Events in Bricks Grouped by ‘Month Year’ with Frontend Filtering by Event Type

Upcoming Events in Bricks Grouped by ‘Month Year’ with Frontend Filtering by Event Type

Updated version of the earlier Upcoming Events Grouped by ‘Month Year’ in Bricks tutorial with some improvements:
Pro
Related Services grouped by Service Categories on Single Branch Posts in Bricks

Related Services grouped by Service Categories on Single Branch Posts in Bricks

How to query ACF relationship fields on single CPT templates.
Categories:
How to Show Future Events in Bricks

How to Show Future Events in Bricks

One of the common requirements in WordPress is being able to filter the events (or could be posts of any post type) to only those…
Categories:
Pro
Child Posts Section in Bricks

Child Posts Section in Bricks

This Pro tutorial provides the steps to limit the posts (can be of any post type) output by Bricks' query loop to children of the…
Categories:
Pro
WordPress Posts using WP REST API in Bricks

WordPress Posts using WP REST API in Bricks

The steps to display posts from any WordPress site that has WP REST API enabled in Bricks builder using a custom query type.
Categories: