breadcrumbspress_post

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_post post="123" path="taxonomy" taxonomy="category" /]
Attributes
Name
Type
Description
Default
post
integer
ID of the post or page to display.
0 (current global post, if available)
path
string
Override the configured path for the post type.
Post type setting
taxonomy
string
Select a taxonomy for a taxonomy-based path.
Post type 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 post’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 post or page. 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_post post="123"]

Replace 123 with the ID of a readable post or page. If post is omitted or set to 0, WordPress uses the current global post when one is available. An unavailable or unreadable post produces no trail.

Choose a taxonomy-based path

[breadcrumbspress_post post="123" path="taxonomy" taxonomy="category"]

This requests a category-based path for post 123. Use a taxonomy registered for the post type and assigned to the post. The result depends on the post type and its available terms; the plugin falls back to another path when the requested path cannot be built.

Customize the output

[breadcrumbspress_post post="123" 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