Current Post’s Terms in Bricks

Current Post’s Terms in Bricks

Updated on 15 Jan 2024

This Pro tutorial provides the steps to set up a grid of terms (like categories) that the current post is assigned to when viewing single posts using a Terms Query Loop in Bricks.

Step 1

Use your favorite custom fields plugin like ACF or Meta Box to create a image-type of custom field for your terms.

Ensure that the ID/name of your field is category_image since the JSON code you are going to paste in the next step references this.

Edit your categories and select/upload a Category Image for each.

Step 2

Edit the template that applies to singular posts of your post type with Bricks.

Copy the Section's JSON from the link below and paste it in your template.

current-post-terms-query-loop

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 524 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Adding any Custom WP_Query loop to Bricks’ Query Loop

Adding any Custom WP_Query loop to Bricks’ Query Loop

Sometimes we may need to create a custom post loop using Bricks' query loop feature, but wish to use our own WP_Query code for more…
Pro
Terms Query in Bricks Filtered by Post Meta

Terms Query in Bricks Filtered by Post Meta

Consider this scenario: CPT: jobTaxonomy: industryCustom field: job_visibility of type Radio with a default value of public. The other value is private. Requirement: Show the…
How to populate a map with dynamic markers from a CPT using ACF in Bricks (PART 2)

How to populate a map with dynamic markers from a CPT using ACF in Bricks (PART 2)

This tutorial provides the PHP & JS codes that can be pasted in order to create a flying effect on map markers each time your…
Pro
Excluding Duplicate Posts from Query Loops in Bricks

Excluding Duplicate Posts from Query Loops in Bricks

How to ensure that posts are not duplicated when two query loops are used on the same page.
Categories: