Emner
Links
Semi-manual Breadcrumb Navigation Plugin for Wordpress
This plugin allows you to add breadcrumb navigation to your Wordpress installation. You can see how it looks by surfing around on the site you are visiting right now – you can also just take a look at the picture below if you don’t feel like surfing.

Functionality
Unlike other Wordpress breadcrumb plugins, this one allows you to manually control the breadcrumb structure. At the same time it takes care of a few things automatically, so that’s why I call it semi-manual breadcrumb navigation.
You can use pages to create levels in your breadcrumb navigation, just like I have done on the picture above (“biler og motorcykler” being the top level and “limousiner” the second level). The texts displayed automatically matches the names of your pages and posts.
My plugin probably aren’t that useful for traditional blogs, but I believe it’s excellent for relatively static sites that use Wordpress as a CMS (like the site you are visiting right now).
Database
Two tables are created in the Wordpress database when you active this plugin:
- asiden_breadcrumbs_pages – this one allows you to create two levels of pages as described above. Thereby you can create a form of index for your site.
- asiden_breadcrumbs_categories – The normal Wordpress category views (where you see all the posts in a certain category) didn’t fit my website. Instead I have manually created a page for each category. This table links the Wordpress categories with the manually created pages, so my plugin knows how to display things.
You will need to edit these two tables manually before you can use my plugin:
- asiden_breadcrumbs_pages – type the ids for all the page and parent_page relationships. If for example page 324 is the parent page of page 327:

- asiden_breadcrumbs_categories – type the ids for all the category and page relationships. If for example category 21 is described on page 324:

The id column is auto incremented in both tables. You can for example use the excellent SQLyog tool to edit the tables.
Code
When you are finished editing the tables, you just need to tell Wordpress where to show breadcrumb navigation. You do that by adding a few lines of code to your theme files:
$currentPageID = $wp_query->post->ID;
DisplayBreadcrumbs($currentPageID, $wpdb);
Remember to add the code everywhere you want to display breadcrumb navigation, i.e. in both the post and page php files.
Final Notes
If you add/remove pages or categories later on, you do of course need to edit the tables.
Download
You can download my breadcrumb navigation plugin here.
The plugin is free and licensed under the terms of the GNU General Public License. Please be aware that I cannot be held responsible if it blows up your Wordpress installation, ruin your life, etc.
6 kommentarer til “Semi-manual Breadcrumb Navigation Plugin for Wordpress”
Skriv en kommentar

June 30th, 2008 at 17:54
great work, thank you for this very useful plugin!
July 1st, 2008 at 10:22
Frickin’ awesome work! This is one of those things that should have been included i WP from the beginning.
July 4th, 2008 at 10:18
Hi, I must admit your plugin does fit perfectly for one of my projects. However I’m missing one small thing (it’s always something isn’t it…).
Would it be possible without too much work to expand from just 2 levels to 3 or 4 (or even indefinite)? Possibly by allowing for sort of like an array structure on the second row in the tables (e.g. value1, value2, value3)…
Just a thought, otherwise great work!!
July 4th, 2008 at 15:13
hi. Thanks for plugin
perfect.
Regards
July 4th, 2008 at 19:55
Yes, I guess that would be possible. Unfortunately I haven’t got time to do it right now, but it shouldn’t be to difficult (the code/database structure is relatively simple).
Please write a comment here if you/someone else make such changes to the plugin.
April 7th, 2009 at 14:49
Just wondering if the modification to expand down through levels was done?
I am just taking a look at this now. Thanks