How to: Breadcrumb function for Wordpress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function the_breadcrumb() {
  2. if (!is_home()) {
  3. echo '<a href="';
  4. echo get_option('home');
  5. echo '">';
  6. bloginfo('name');
  7. echo "</a> » ";
  8. if (is_category() || is_single()) {
  9. the_category('title_li=');
  10. if (is_single()) {
  11. echo " » ";
  12. the_title();
  13. }
  14. } elseif (is_page()) {
  15. echo the_title();
  16. }
  17. }
  18. }
  19.  
  20.  
  21.  
  22. <?php the_breadcrumb(); ?>

URL: http://www.catswhocode.com/blog/how-to-breadcrumb-function-for-wordpress

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.