Updated on December 17, 2020
- The terms will be linked to corresponding term archive pages.
- There is an additional
excludeparameter for the shortcode using which one or more term IDs can be excluded.
The shortcode shared here allows you to display comma-separated linked terms of the specified taxonomy (can be standard ones or a custom taxonomy) when viewing single pages of a post or any other Custom Post Type.
[post_terms_linked taxonomy="portfolio_category" exclude="32,212" before="Categorized under: "]
Let's say a
Custom Post Type item has been these
s: Branding and Featured.
Assuming a scenario where you have selected the "Featured" portfolio category for the purposes of making this CPT entry appear inside a slider on the homepage you would typically not want "Featured" to appear in this post's terms list.
[post_terms_linked taxonomy="portfolio_category" exclude="45"]
where 45 is the ID of "Featured" term:
The available shortcode parameters (all optional) are:
- taxonomy: name of a taxonomy. Default:
- exclude: Comma-separated IDs of post terms to be excluded. Do NOT put space after commas. Default:
- sep: String that should separate each term link. Default:
,(a comma followed by a space)
- before: String to appear before the terms. Default:
- after: String to appear after the terms. Default:
Install and activate Code Snippets plugin.
Go to Snippets > Add New.
Title: [Shortcode] Linked Taxonomy Terms
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $499 one-time).
Already a member? Log in below or here.