Breadcrumbs
Show a breadcrumb trail with a shortcode, a block or a template function. It's the same trail as the BreadcrumbList structured data search engines read.
- Home › Products › Shirts › Linen Shirt
Adding breadcrumbs
In the block or site editor, add the Siteryn Breadcrumbs block (Theme category), usually to your single post or product template. Option: Separator (default ›).
[siteryn_breadcrumbs] [siteryn_breadcrumbs separator="/" home="Start"]
separator: the character between items (default ›, empty for none). home: a different label for the first item.
<?php
if ( function_exists( 'siteryn_seo_geo_aeo_breadcrumbs' ) ) {
siteryn_seo_geo_aeo_breadcrumbs( array( 'separator' => '›' ) );
}
// Return instead of print: array( 'echo' => false )
How the trail is built
| Page | Trail |
|---|---|
| Post | Home › Blog (your posts page, if set) › Category › its parents › Post |
| Page | Home › Parent pages › Page |
| Custom content / product | Home › Archive (e.g. Products) › Term or parent pages › Item |
| Category or term archive | Home › Archive › Parent terms › Term |
| Author, date, search | Home › Author name / date / Search results for "…" |
The term is taken from the first hierarchical taxonomy of the content type. Breadcrumbs aren't shown on the front page or when the trail has a single item.
siteryn_seo_geo_aeo_breadcrumbs filter (see Developer guide).Markup & styling
<nav class="siteryn-breadcrumbs" aria-label="Breadcrumb">
<ol class="siteryn-breadcrumbs__list">
<li class="siteryn-breadcrumbs__item"><a href="/">Home</a><span class="siteryn-breadcrumbs__sep" aria-hidden="true">›</span></li>
<li class="siteryn-breadcrumbs__item"><span aria-current="page">Current page</span></li>
</ol>
</nav>
A tiny stylesheet lays the items out in a row. Style it from your theme with the classes above.
Structured data
The same trail is output as BreadcrumbList structured data on every page with 2+ items (when structured data is on), whether or not you display the breadcrumbs. The home label changes only the visible text.