How to add Breadcrumbs in WordPress without plugin

Breadcrumbs is a great navigation aid that we can mostly see in horizontally pattern across the top of a web pages, often below title bars or headers.

Home >> Category >> Sub Category >> Product

Breadcrumb trail provide users an alternative method of navigation. It help visitors to track their current location in website hierarchy with easily navigate back to the starting point or entry level point and reduce the number of steps for navigate to one page to another in website.

In WordPress, Breadcrumb navxt, breadcrumb-trail, Really Simple Breadcrumb etc Plugin available for add breadcrumb navigation in website. In Current post I’m going to explain how to add breadcrumb in WordPress blog / site without use of any Plugin in just 2 step.

Step 1:

add following function my_breadcrumb  in functions.php

';
	if (!is_home()) {
		echo '
  • '; echo 'Home'; echo "
  • "; if (is_category() || is_single()) { echo '
  • '; the_category('
  • '); if (is_single()) { echo "
  • "; the_title(); echo '
  • '; } } elseif (is_page()) { echo '
  • '; echo the_title(); echo '
  • '; } } elseif (is_tag()) {single_tag_title();} elseif (is_day()) {echo"
  • Archive for "; the_time('F jS, Y'); echo'
  • ';} elseif (is_month()) {echo"
  • Archive for "; the_time('F, Y'); echo'
  • ';} elseif (is_year()) {echo"
  • Archive for "; the_time('Y'); echo'
  • ';} elseif (is_author()) {echo"
  • Author Archive"; echo'
  • ';} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "
  • Blog Archives"; echo'
  • ';} elseif (is_search()) {echo"
  • Search Results"; echo'
  • ';} echo ''; } ?>

    Step 2 :

    To display the Breadcrumbs menu, just use my_breadcrumb function to display it wherever you want in your website.

    Breadcrumbs in WordPress

    Leave a Comment

    Scroll to Top