Breadcrumb navigation for WordPress, with data for any template
Breadcrumbs generates a Home › Category › Post style trail and leaves the rendering entirely up to you — via a PHP function, a shortcode, or directly in a Twig template. It also automatically adds schema.org structured data for search engines.
Key features
- The smrk_breadcrumbs() function returns a structured array of {label, url, is_home, is_current} — no forced HTML
- A [smrk_breadcrumbs] shortcode for quick use with no PHP required
- On Timber-based sites, the same data is also exposed as a Twig function — {{ fn('smrk_breadcrumbs') }} works with zero extra glue code
- Configurable text or custom HTML for the "Home" label
- Configurable trail separator (text or HTML)
- Optional inclusion of selected post types’ archive pages in the trail
- Automatic schema.org BreadcrumbList (JSON-LD) output for rich-snippet eligibility
How it works
smrk_breadcrumbs() builds the trail from the current WP_Query context (post type, taxonomy, archive, search) and returns each step as plain data, with zero HTML tags — how the trail gets rendered (ul/li, spans with separators, anything) is entirely up to the theme template.
When the module detects an active Timber install, it registers the same function as a Twig function too, so {{ fn('smrk_breadcrumbs') }} works in a template with no additional glue code. The same data is also used to build a schema.org BreadcrumbList JSON-LD block printed into <head>.