15th Mar '24
/
3 comments

Primary Term for Posts using The SEO Framework in Bricks

Updated on 18 Mar 2024

The SEO Framework is one of the better (coding-wise) SEO plugins.

Like Yoast and Rank Math, it has the option to specify a category or a term as primary when editing posts.

This Pro tutorial provides the steps to output the linked primary term and all other linked terms of the current post (either in single view or in a query loop) separately in Bricks.

Step 1

Let's define a custom function that takes the taxonomy as the first argument and the primary term object's property to retrieve (defaults to name) as the second argument.

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
Filtering a Bricks Terms query on Term archive pages

Filtering a Bricks Terms query on Term archive pages

On product category archives, how to show product type names but only those that the current product category has.
Pro
Prefiltering Bricks Terms Query Loop

Prefiltering Bricks Terms Query Loop

Let's say there's a Events CPT with a 'Event Year' custom taxonomy. Sample event year names could be: 2021, 2022, 2024, 2025, 2028 etc. We…
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…