Breadcrumbs

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>.

Frequently asked questions

Do I have to render the trail exactly the way the module does?
No — the function only returns structured data; you write the HTML and CSS exactly to your own template’s needs.
Does it work without Timber?
Yes, the base is a plain PHP function and a shortcode. The Twig function is registered additionally, only when the site actually uses Timber.
Does it help with SEO?
Yes — schema.org structured data (BreadcrumbList) is added automatically, which can let search engines show the trail directly in results.