How To Style a Breadcrumb Like Apple.com Style Breadcrumb in WordPress

In our previous article, “How to Add Breadcrumbs Without Plugin and Best Practice” we have made a simple breadcrumb. In this tutorial we’re going to turn our breadcrumb into something that looks like the ones you see on Apple.com!

Style-Your-Breadcrumb2

You can see apple style breadcrumb here.

apple_style

And what would we make, the end result like this

Breadcrumb

How to?

Step 1- prepare the images

You can use this images : download images, consisting of :

  • home.png
  • breadcru.png
  • right-ch.png
  • breadcru_right.png
  • breadcru_left.png

then upload to your /images folder ini your themes folder.

Step 2 – add this code to function.php

We modify this code ( on simple breadcrumb) so it became like this :

/*breadcrumb function*/
<?php
function the_breadcrumb() {
      if ( !is_home() ) {
          echo '<div class="breadcrumbleft" ></div><div class="breadcrumb" > <a style="float: left; color: #555555;" href="';
          echo get_option('home');
          echo '">';
          echo '<img src="http://www.yoursite.com/wp-content/themes/your_themes/images/home.png" style="margin-top: 5px;"/>';
          echo "</a> <div class=\"arrowbread\" ></div> ";
          }

          if ( is_category() || is_single() ) {
               $category = get_the_category();
               $ID = $category[0]->cat_ID;
               echo '<div>'.get_category_parents($ID, TRUE, '', FALSE ).'</div>';
          }

          if(is_single()) {echo ' <div></div>';the_title();}
          if(is_page()) {the_title();}
          if(is_tag()){ echo "Tag: ".single_tag_title('',FALSE); }
          if(is_404()){ echo "404 - Page not Found"; }
          if(is_search()){ echo "Search"; }
          if(is_year()){ echo get_the_time('Y'); }            

          echo "</div><div class=\"breadcrumbright\" ></div><div class=\"clear\"></div>";
    }
?>
/*end*/

Step 3 – Style your CSS file

Next thing we need to do is the CSS. Go into your style.css and paste the following:

/* breadcrumb style*/
.breadcrumb{
 background: url(/articles_and_tutorials/how_to_style_a_breadcrumb_like_apple_com_style_breadcrumb_in_wordpress/images/breadcru.png) repeat-x;
 color: #555555;
 line-height: 180%;
 padding: 0 10px 0 10px;
 float: left;
 margin-bottom: 10px;
}
.arrowbread{
 background: url(/articles_and_tutorials/how_to_style_a_breadcrumb_like_apple_com_style_breadcrumb_in_wordpress/images/right_ch.png) -1px 50% no-repeat;
 margin: 0 7px;
 width: 17px;
 height: 22px;
 float: left;
}

.breadcrumblink{
 float: left;
}

.breadcrumblink a{
 color: #555;
}

.breadcrumblink a:hover{
 color: #FFF;
}

.breadcrumbright{
 float:left;
 width:8px;
 height:22px;
 background: url(/articles_and_tutorials/how_to_style_a_breadcrumb_like_apple_com_style_breadcrumb_in_wordpress/images/breadcru_right.png) 0 50% no-repeat;
}

.breadcrumbleft{
 float:left;
 width:7px;
 height:22px;
 background: url(/articles_and_tutorials/how_to_style_a_breadcrumb_like_apple_com_style_breadcrumb_in_wordpress/images/breadcru_left.png) 0 50% no-repeat;
}
/* end breadcrumb style*/

Step 4 – Done!

Don’t forget to put this code

<?php the_breadcrumb(); ?>

in your single.php, archive.php and page.php.

If you review the code carefully, you can notice that you can create a variety of designs by changing background and separator images. Try and see the results!

Further Resources :

38 Comments to “How To Style a Breadcrumb Like Apple.com Style Breadcrumb in WordPress”

Add Comments (+)

  1. cna training says:

    What a great resource!

  2. dwidrg says:

    artikel bagus……..numpang ngeksis dulu dari balikpapan

  3. Hey this blog is great. I’m glad I came by this blog. Maybe I can contribute in the near future.

  4. I really liked your blog! great

  5. Wonderful professional level themes, but this php is a bit hard to implement for a beginner like me. if someone can send me the LightFolio function.php, style.css, single.php, archive.php and page.php already hacked i would be grateful. Thank you for your time.

  6. This is exactly the information I was looking for, thanks!

  7. Yücel says:

    can not download images ???

  8. verizon saga says:

    wuich keren ..

    masuk dalam “very-useful-65-wordpress-hacks”

  9. What a great blog on How To Style a Breadcrumb Like Apple.com Style Breadcrumb in WordPress | DynamicWP !

  10. Thanks for this tip. I originally had the breadcrumb, but I did not cater for the tag,search, 404 condictions. This helped me to include them and now it looks so much better.

  11. satrya says:

    Wihh,, keren nihm mksih tutornya :mrgreen:

  12. satrya says:

    Mas koq gk berhasil ya ? acak2an stylenya :(

    • satrya says:

      seperti ada yg kurang classnya mas ? .breadcrumbleft nya gk ada loh mas ? bingung nih :mrgreen:

      • Eko S. says:

        Maaf mas baru bales..hehe..
        Class .breadcrumbleftnya ada kok mas…

        .breadcrumbleft{
        	 float:left;
        	 width:7px;
        	 height:22px;
        	 background: url(/articles_and_tutorials/how_to_style_a_breadcrumb_like_apple_com_style_breadcrumb_in_wordpress/images/breadcru_left.png) 0 50% no-repeat;
        }
        
      • satrya says:

        Bukan pada css nya mas, tapi di functionnya.. maaf banyak koment :mrgreen:

      • Eko S. says:

        Wah…makasih mas uda ngingetin, kok selama ini ga ada yang nanyain ya?
        Uda kami perbaiki file function.php -nya.
        Pada baris ke -5 di tutorial ini ada yang hilang, sudah kami tambahkan seperti ini :

        echo '<div class="breadcrumbleft" ></div><div class="breadcrumb" > <a style="float: left; color: #555555;" href="';
        

        Makasih :)

      • satrya says:

        Oke sip, di coba dulu mas… iya yah aneh koq gk ada yg kasih tau ada kode yang kurang. :mrgrenn:
        Thx jawabannya mas. :)

      • satrya says:

        mrgreennya gk muncul.. ulang lagi deh :mrgreen:

  13. I have never had any luck creating my own bread crumb. Thank you for the helpful insight, I hope this works.

  14. Thanks for this tutorial. Need to do this on my blog ASAP!

  15. Ervin Doubet says:

    Very good site, where did you come up with the info in this post? Im glad I found it though, ill be checking back soon to see what other articles you have.

  16. aand says:

    bisa di buat di blogger mas breadcrum ini?

    rhanks infonya..

  17. I am glad that I found this website, precisely the right information that I was looking for!

  18. Rachael says:

    hi there

    i want to try this out, but I’m not to good at PHP and this may be quite simple, but where does the breadcrumb code go in the functions.php file. Where do you place it?

    Hope you can help?

    Thanks

  19. Kim says:

    Cheers for the tutorial, really nice! :)

  20. tdorr07 says:

    How do I get it to display parent pages as well?
     
    Thanks

  21. zetar says:

    Yes,your point is great,if you are interesting in packaging,plaese scan the next.
    Life is like to buy a packaging, buy a good packaging like to find a good object, we mutually consistent. Buy a bad package, simply do not fit your product, but not worth the candle, if forced to use an incompatibility with their own objects, even if married, it will not last long. Cherish life, to find a good object, buy a good packages.We are special in packaging and  Package Manufacturer and please send email to: info@zetarpackaging.com, our website is http://www.zetarpackaging.com

  22. Ghandi says:

    Hi, thanks for this, I really like the look of it and it’s so easy to implement.

    My only questions is, and I don’t know if it’s a daft one, but how do I get the breadcrumb trail to be multi-level? Every page and post just displays [H] > Page Name, where [H] is the home icon. I have tried using categories.

    Thanks,
    Ghandi

  23. mohit says:

    hey thnks a lot for this lovely post and breadcrumbs styling!! thnsk a lotttt

  24. waw…very helpfull. Thank’s

Trackbacks/Pingbacks

  1. How To Style a Breadcrumb Like Apple.com Style Breadcrumb in … | Drakz Free Online Service
  2. Premium Clear Durable Soft Silicone Skin Cover Case for Nintendo Wii Fit Balance Board + Wii Remote and Nunchuck + Fishbone Style Keychain | Movies & Video Games
  3. uberVU - social comments
  4. wp-popular.com » Blog Archive » How To Style a Breadcrumb Like Apple.com Style Breadcrumb in Wordpress | DynamicWP
  5. Very Useful 65 Wordpress Hacks | Design your way
  6. Very Useful 65 Wordpress Hacks | Web Development News
  7. Alex Jones Tv {Sunday Edition} 7/9: Welcome to “Pentagon Style” Internet & The Next Level of Tyranny : World online computer review
  8. Very Useful 65 Wordpress Hacks | Stevelizardi.com
  9. Breadcrumb style | Ztinfo
  10. Very Useful 65 WordPress Hacks » Stevelizardi.com

Leave a Reply

 

Amazingly Beautiful WordPress Themes