It is a common requirement to show posts (posts/CPT items) that belong to the same taxonomy (category/tag/custom taxonomy) as the current single post.
This Pro tutorial shows how this can be done in Bricks taking the example of testimonial
Custom Post Type and testimonial_type
as the taxonomy.
We are going to
- exclude the current single testimonial post from being output in the related testimonials list.
- add "s" at the end of "Related Testimonial" heading when there is more than one related testimonial.
- ensure that the Section gets output only if there is at least one related testimonial.
to limit the posts to those that belong to the same taxonomy term as the current single testimonial post.
Step 1
In your single post/CPT Bricks template, add a Section.
Inside the Section's Container, add a Heading that reads something like "Related Testimonial".
Add a Posts element or set up a Query Loop.
Set your post type, the number of posts to be pulled and tick "Exclude current post".

Step 2
This is a Pro members-only tutorial.
To get full access, login below or sign up for a Pro Account
Christian Strand
Great tutorial. For some reason the filter for adding s doesn’t seem to work my end despite even renaming the heading element to the same as you have used.
Sridhar Katakam
Make sure `brxe-` is not present in the value on the right side that you are checking against in `$element->id === ‘gavtcq’`.
Christian Strand
Still not working. This is the heading element name in my own template: “gavtcq”
Here is the element:
Linked post
And here is the code:
id === ‘gavtcq’ && bl_get_testimonial_count() > 1 ) {
$settings[‘text’] .= ‘s’;
}
return $settings;
}, 10, 3 );
Sridhar Katakam
Can you send your site’s WP admin login via https://brickslabs.com/support/? You may want to use https://wordpress.org/plugins/temporary-login-without-password/.