Breadcrumbs
Slim SEO has the breadcrumbs support via the [ slim_seo_breadcrumbs ]
shortcode. Using the shortcode, you can output the breadcrumb trail on your WordPress website easily.
Note: Please remove the extra spaces after [
and before ]
when copy and paste the shortcode.
Slim SEO supports aria-*
for breadcrumbs for better accessibility.
Shortcode attributesโ
The [ slim_seo_breadcrumbs ]
shortcode has the following attributes (all are optional):
separator
: The separator between breadcrumb items. Defaultยป
.display_current
: Whether or not display the current page. Defaulttrue
.taxonomy
: The taxonomy that you want to output in the breadcrumb trail when you're on a single post (or post type). Defaultcategory
.label_home
: Label for home item. DefaultHome
.label_search
: Label for search results page. DefaultSearch Results for โ%sโ
.label_404
: Label for 404 page. DefaultPage not found
.
Styling breadcrumbsโ
To make it easier to style breadcrumbs, the plugin uses some CSS classes:
breadcrumbs
: For the wrapper of the breadcrumbs.- Each breadcrumb item has a class
breadcrumb
. - The first and the last breadcrumb item has a class
breadcrumb--first
andbreadcrumb--last
correspondingly. It's very useful when you want to style the "Home" with icon or something similar. - Separator has a class
breadcrumb__separator
.
Using these class, you're able to style every detail of the breadcrumb trail.
Output breadcrumbs with PHPโ
If you want to output the breadcrumbs in your template with PHP, simply do this:
echo do_shortcode( '[ slim_seo_breadcrumbs ]' );