Search Engine Optimized breadcrumbs

I had a need to build some search engine optimized breadcrumbs for a project I’m working on right now.  I didn’t want to just use Yoast’s breadcrumbs, because I’m using Twitter Bootstrap, and I wanted to make use of the built-in breadcrumbs support, so I did a Google, found something, tweaked it and am using it on this project.  I wanted it to support both page and blog post hierarchy, the original source did not support page hierarchy, just post categories.  Everything works automagically, all you need to do is use the seo_breadcrumbs() php function.

Here are some screenshots of it in action:


Breadcrumbs in a post, when a page has been set for blog posts (other than the Home page)


Breadcrumbs in a post, when no page has been set for blog posts (default Reading setting)


Breadcrumbs in a page, when the page has a parent


Breadcrumbs in a page, when there is no parent page

Here’s the code:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.