Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //put the bellow code in funtions.php
- function get_breadcrumb() {
- echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
- if (is_category() || is_single()) {
- echo " » ";
- the_category(' • ');
- if (is_single()) {
- echo " » ";
- the_title();
- }
- } elseif (is_page()) {
- echo " » ";
- echo the_title();
- } elseif (is_search()) {
- echo " » Search Results for... ";
- echo '"<em>';
- echo the_search_query();
- echo '</em>"';
- }
- }
- //Execute the following function if not work above for category display.
- function get_breadcrumb()
- {
- echo '<a href="' . home_url() . '" rel="nofollow">Home</a>';
- if (is_tax() || is_single()) {
- echo " <span class='ic_breadcrumb'>></span> ";
- the_title();
- the_category(' • ');
- if (is_single()) {
- echo "<span class='ic_breadcrumb'> > </span>";
- the_title();
- }
- } elseif (is_page()) {
- echo " <span class='ic_breadcrumb'>></span> ";
- echo the_title();
- } elseif (is_search()) {
- echo " <span class='ic_breadcrumb'>></span> Search Results for... ";
- echo '"<em>';
- echo the_search_query();
- echo '</em>"';
- }
- }
- // implement now in html bellow php code
- <div class="breadcrumb"><?php get_breadcrumb(); ?></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement