in ,

Display Breadcrumbs To Your WordPress Website

In this article I show you how to put breadcrumb in your WordPress website by using function the_breadcrumb(), will get the breadcrumbs for the current page this will need to go into the functions.php page.

[php]function the_breadcrumb() {
if (!is_home()) {
echo ‘<a href="’;
echo get_option(‘home’);
echo ‘">’;
bloginfo(‘name’);
echo "</a> ". " » ";
if (is_category() || is_single()) {
the_category(‘title_li=’);
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo the_title();
}
}
}[/php]

Go to your single.php page and add the following code anywhere you want to display the breadcrumbs.

[php]<?php the_breadcrumb(); ?>[/php]

What do you think?

Written by Sopheap

The goal of me is sharing new ideas, inspiration art, fresh and useful resource, covering web design and development, graphic design, advertising, mobile development and life style.

Comments

Leave a Reply

Your email address will not be published.

create widge area in wordpress

Create Widget Area For Your WordPress

create custom post type

Create Custom Post Type In WordPress