breadcrumbspress_term

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

Definition
[breadcrumbspress_term taxonomy="category" term="news" /]
Attributes
Name
Type
Description
Default
taxonomy
string
Taxonomy slug; use it to identify the taxonomy for a term slug.
Empty
term
string or integer
Term slug or term ID.
Empty
path
string
Override the configured path for the taxonomy.
Taxonomy setting
rich_snippet
boolean
Include breadcrumb JSON-LD structured data when true.
Plugin setting
list
string
Choose an ordered list (ol) or an unordered list (ul).
Plugin setting
id
string
HTML ID for the rendered breadcrumb trail.
Empty
class
string
Additional CSS class for the rendered breadcrumb trail.
Empty
Output
The term’s breadcrumb trail as HTML, optionally with JSON-LD. If no trail is rendered, the shortcode wrapper remains empty.

Display a breadcrumb trail for a specific taxonomy term. This shortcode is available in BreadcrumbsPress Lite and Pro. Add it to a Shortcode block or another shortcode-enabled area.

The definition illustrates selected attributes; all supported attributes and their defaults are listed above.

Basic usage

[breadcrumbspress_term taxonomy="category" term="news"]

Replace category with the taxonomy slug and news with the term slug. An invalid or unreadable term produces no trail.

Use a term ID

[breadcrumbspress_term taxonomy="category" term="123"]

Replace 123 with the term ID. The taxonomy identifies the expected taxonomy for the term.

Choose a taxonomy path

[breadcrumbspress_term taxonomy="category" term="news" path="taxonomy"]

This requests a taxonomy-based path. Whether parent terms appear depends on the taxonomy hierarchy settings and the term. Omit path to use the taxonomy’s configured path.

Customize the output

[breadcrumbspress_term taxonomy="category" term="news" list="ul" rich_snippet="false" class="my-trail"]

This uses an unordered list, disables JSON-LD for this shortcode, and adds a CSS class to the trail. Without these attributes, the list type and structured data follow the plugin settings. Check for duplicate trails or structured data when another integration is active.

Rate this reference
0
0
2

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0