Breadcrumbs in web terms are a chain of links that leads the user back to the main index page. This article will teach you how to manually create your own breadcrumbs within WordPress. You will place these codes in your WordPress themes just underneath your header, for example.
Create a Home
Let’s get started. Let’s create a home. Use this HTML and PHP code.
<a href=”<?php bloginfo(‘url’);?>”>Home</a>
Double Angle Quotation Marks
Let’s use a Guillemet or a Double Angle Quotation Mark to separate the links.
The symbol » equals to “»” in HTML.
Post and Page Titles
Let’s display the titles. The code for both post and page titles are the same.
<a href=”<?php echo get_permalink() ?>”><?php the_title(); ?></a>
All Together Now
<a href=”<?php bloginfo(‘url’);?>”>Home</a> » <a href=”<?php echo get_permalink() ?>”><?php the_title(); ?></a>
Just place this piece of code in your WordPress theme files: e.g. pages.php and single.php. For the main index.php page, you just need the Home link.
That’s it. Fairly easy.
You can get really elaborate by adding Categories, Months and Dates in your breadcrumb. Nevertheless, this article will get you started in the right direction.