Custom Taxonomy Shortcode

🧩 Plugin: Custom Taxonomy Shortcode

Displays terms from any taxonomy (Tags, Categories, or custom) via shortcode.

🔧 Shortcode

[taxonomy_terms taxonomy="taxonomy_name"]

✅ Supported Attributes

AttributeDescription
taxonomy(Required) Taxonomy slug (e.g. post_tag, category, collaborators).
post_id(Optional) Post ID. Defaults to the current post.
defaultFallback if no terms exist.
before / afterHTML/text to wrap the output.
eschtml (default), attr, or raw.
nl2brConvert newlines to <br>. Defaults to true.
separatorString to join items. Default is <br>.
linktrue makes each term a hyperlink to its archive.

🧪 Examples

Tags (built-in):

[taxonomy_terms taxonomy="post_tag" separator=", " link="true"]

Categories (built-in):

[taxonomy_terms taxonomy="category" separator=" / "]

Custom taxonomy (e.g. collaborators):

[taxonomy_terms taxonomy="collaborators" separator="<br>"]

🧠 Template Function

echo cts_get( 'collaborators', [
  'separator' => ', ',
  'link' => 'true',
  'default' => 'No collaborators'
]);