Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Since version 1.3.0, the Slim SEO plugin added the breadcrumbs support via shortcode
[slim_seo_breadcrumbs] shortcode. Using the shortcode, you can output the breadcrumb trail on your WordPress website easily.
Slim SEO uses schema.org for the output, thus it's compatible with Google Structured Data recommendation for breadcrumbs. Besides, it supports
aria-* for better accessibility.
[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. Default
taxonomy: The taxonomy that you want to output in the breadcrumb trail when you're on a single post (or post type). Default
label_home: Label for home item. Default
label_search: Label for search results page. Default
Search Results for “%s”.
label_404: Label for 404 page. Default
Page not found.
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
- The first and the last breadcrumb item has a class
breadcrumb--lastcorrespondingly. It's very useful when you want to style the "Home" with icon or something similar.
- Separator has a class
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]' );