Reading Time: < 1 minuteIf you want to add and display breadcrumbs navigation into the wordpress thesis theme, you can do it simply using wordpress hooks.
Look at the following function it will generate the breadcrumbs navigation.The call to it using thesis_hook_after_header
wordpress thesis hook.
function thesis_breadcrumbs() {
echo '';
if ((!is_home()) || (!is_front_page())) {
// home page link/site name
echo '';
bloginfo('name');
echo "";
}
// category and posts
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
}
// pages
elseif (is_page()) {
echo " » ";
echo the_title();
}
// search page
elseif (is_search()) {
echo " » Search Results for... ";
echo '"';
echo the_search_query();
echo '"';
}
echo '
';
} // end the function
How to display breadcrumb
add_action('thesis_hook_after_header','thesis_breadcrumbs');
function thesis_breadcrumbs() {
echo '';
if ((!is_home()) || (!is_front_page())) {
// home page link/site name
echo '';
bloginfo('name');
echo "";
}
// category and posts
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
}
// pages
elseif (is_page()) {
echo " » ";
echo the_title();
}
// search page
elseif (is_search()) {
echo " » Search Results for... ";
echo '"';
echo the_search_query();
echo '"';
}
echo '
';
} // end the function
// call to the function
add_action('thesis_hook_after_header','thesis_breadcrumbs');