How to show breadcrumbs without a plugin for Twenty Twelve Theme in WordPress

I am huge technology lover. I will want to know about everything related with technology. I like to make everything with the pieces of codes. I love to code, debugging and many a times got entangled into these sorts of programs that most projects especially wordpress and android got intrigued and most of it does not work most times. While writing the posts of blog it does not come in the prior but it continues to find my memory through some sort of instant requirements of what should have been the need for sites and what should be done with it.

While moving to any shopping malls we first look at the categories mentioned and then we move towards our requisite categories and that is the way website works. In my website there has been more that 2000 articles and continuing till to date and I have found there has been some sort of navigational difficulties while measuring my site with Google page rank tools. I first failed to understand what it should have been but ultimately come to realize the importance of it. I first see there has been the presence of pagination, read more, archive, categories, feed and so on but still unable to find what it could have been in terms of Google wanting to convey.
That is why the concept of breadcrumb comes to the upfront.

The simple forms of breadcrumbs are very important as it conveys Google about relevance of the series of navigation of any site such as, suppose you have written one article on wordpress and that is inside wordpress seo. With breadcrumb while reaching at the same spot on the site that should show that you are on the home page or from the front page towards the category of seo and then towards the name of the article. It does help Google to understand the relevant of site structure and also provides more lights on the aspect of understanding the website structures. It helps Google and other search giants to understand the importance attached to your site and it helps search engines to understand the most possible way your site works.

In this post I am going to elaborate in detail about how install breadcrumb in twentytwelve theme. This tutorial could be applicable to all themes with some sort of editing. How to show them in a single page, category pages, search pages. This tutorial is all about how install breadcrumb without cumber some plugins. We should learn about how to do this with a simple coding structure. In this tutorial two php files will be edited, one being the functions dot php and the other being the header dot php. I should expect you to be well guarded with the functionalities of editing of website. One should always do this from cPanel hostings and then files, then file manager, then wp content and themes and then choose currently activated theme.

There has been many plugins on breadcrumbs but with these simple tutorials you do not need to apply for any plugins but with this simple pieces of codes yours wordpress breadcrumb navigation should work straight forward. This code should show you dynamic breadcrumb code which means it should show you about which page you are landing and its hierarchical representation of where you are on the site. This not only helpful for visitors but also very much helpful for search engines in detecting the exact location of the article. It provides intuitive meanings to your website and enhances productivity and functionalities of your website to the maximum extent. Visitors could easily reach towards back of the page from where they reached and in this way thus enhancing the ultimate potential of website to its maximum extent.

It provides some of the most wonderful aesthetic elements to show case the beauty of website to a greater extent. Google search indexing feels very easier for indexing such web pages to a greater extent and slowly it improves better crawling of yours website to provide and showcase one of the most widely anticipated search algorithms. It is important you should always back up theme files, when you implement such codes so that whenever you got it wrong then you could easily reverse it. I test this coding in twentytwelve theme but am sure with a little bit of editing and other forms of code hacks this codes should work nicely with every theme.

Breadcrumbs without plugin

Do not edit theme files from wordpess administration. Use cPanel hosting parameters for hosting purposes. This hacking should work in two ways. First edit the functions dot php by reaching from cPanel hosting and then for appearance of breadcrumb you could use single dot php, category dot php, search dot php and so on but if you wish to show it on every page except that of home page of blog then it is better to use it on header dot php.

Code snippet: Functions dot php

<?php
function the_breadcrumb() {
 echo '<ul id="crumbs">';
 if (!is_home()) {
 echo '<li><a href="';
 echo get_option('home');
 echo '">';
 echo 'Home';
 echo "</a></li>";
 if (is_category() || is_single()) {
 echo '<li>';
 the_category(' </li><li> ');
 if (is_single()) {
 echo "</li><li>";
 the_title();
 echo '</li>';
 }
 } elseif (is_page()) {
 echo '<li>';
 echo the_title();
 echo '</li>';
 }
 }
 elseif (is_tag()) {single_tag_title();}
 elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';}
 elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';}
 elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';}
 elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';}
 elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
 elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
 echo '</ul>';
}
?>

 

Reached at the end of functions dot php file and then copy and paste this code and then save it.

Code snippet: header dot php

Search for the following code in header dot php

</nav><!-- #site-navigation -->

Then add the following code just above the above code (site navigation).

<?php the_breadcrumb(); ?>

This would make breadcrumb appear just like another menu under the primary menu structure. If you want to show these on the side bar or at the end of the article then you can paste it on the sidebar dot php or single dot php instead of header dot php. The proposed pasting of this code at header dot php is an example of showing the code at some location and you could be innovated and could apply the second part of the code to anywhere you like so that ultimately, the choice is of yours.

Do not worry about the location of breadcrumbs shown on the site, keep experimenting at different places by putting the second part of the code in website and ultimately you could find the presence of the right areas where the breadcrumb should be very much comfortable for your liking. It is up to you to find out the exact location.

I found it to be installed nearer to main navigation menu and that shows extremely comfortable for me and that show breadcrumb as the part of navigational menu, you could innovate and use it in side bar, in footer or at the end of the single article or at the beginning of the article. The choice is with yours. Why wait for this, as it is good for search engine optimization as well as it is good for visitors to know the category of the article so that they could stay or some more second at your article. Do it on your own and ditch any breadcrumb plugins and be a smart code manager and a wonderful system administrator?

*A few days ago. I read a post on wp-snippets.com which discussed ‘Breadcrumbs without plugin’. I’d never hear of this before, but I was intrigued, so I read on.*

Leave a Reply

Your email address will not be published. Required fields are marked *

Popular Posts