evolve_breadcrumb

The evolve evolve breadcrumb function.

Description

evolve_breadcrumb(); 

Usage

  1. if ( !function_exists( 'evolve_breadcrumb' ) ) { 
  2. require_once '/library/functions/basic-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = evolve_breadcrumb(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/library/functions/basic-functions.php  
  1. function evolve_breadcrumb() { 
  2. global $data, $post; 
  3.  
  4. echo '<ul class="breadcrumbs">'; 
  5.  
  6. echo '<li><a class="home" href="'; 
  7. echo home_url(); 
  8. echo '">' . __('Home', 'evolve'); 
  9. echo "</a></li>"; 
  10.  
  11. $params['link_none'] = ''; 
  12. $separator = ''; 
  13.  
  14. if (is_category()) { 
  15. $category = get_the_category(); 
  16. $ID = $category[0]->cat_ID; 
  17. echo is_wp_error($cat_parents = get_category_parents($ID, TRUE, '', FALSE)) ? '' : '<li>' . $cat_parents . '</li>'; 
  18.  
  19. if (is_tax()) { 
  20. $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); 
  21. echo '<li>' . $term->name . '</li>'; 
  22.  
  23. if (is_home()) { 
  24. echo '<li>' . __('Blog', 'evolve') . '</li>'; 
  25. if (is_page() && !is_front_page()) { 
  26. $parents = array(); 
  27. $parent_id = $post->post_parent; 
  28. while ($parent_id) : 
  29. $page = get_page($parent_id); 
  30. if ($params["link_none"]) { 
  31. $parents[] = get_the_title($page->ID); 
  32. } else { 
  33. $parents[] = '<li><a href="' . get_permalink($page->ID) . '" title="' . get_the_title($page->ID) . '">' . get_the_title($page->ID) . '</a></li>' . $separator; 
  34. $parent_id = $page->post_parent; 
  35. endwhile; 
  36. $parents = array_reverse($parents); 
  37. echo join(' ', $parents); 
  38. echo '<li>' . get_the_title() . '</li>'; 
  39. if (is_single() && !is_attachment()) { 
  40. $cat_1_line = ''; 
  41. $categories_1 = get_the_category($post->ID); 
  42. if ($categories_1): 
  43. foreach ($categories_1 as $cat_1): 
  44. $cat_1_ids[] = $cat_1->term_id; 
  45. endforeach; 
  46. $cat_1_line = implode(', ', $cat_1_ids); 
  47. endif; 
  48. $categories = get_categories(array( 
  49. 'include' => $cat_1_line,  
  50. 'orderby' => 'id' 
  51. )); 
  52. if ($categories) : 
  53. foreach ($categories as $cat) : 
  54. $cats[] = '<li><a href="' . get_category_link($cat->term_id) . '" title="' . $cat->name . '">' . $cat->name . '</a></li>'; 
  55. endforeach; 
  56. echo join(' ', $cats); 
  57. endif; 
  58. echo '<li>' . get_the_title() . '</li>'; 
  59. if (is_tag()) { 
  60. echo '<li>' . "Tag: " . single_tag_title('', false) . '</li>'; 
  61. if (is_404()) { 
  62. echo '<li>' . __("404 - Page not Found", 'evolve') . '</li>'; 
  63. if (is_search()) { 
  64. echo '<li>' . __("Search", 'evolve') . '</li>'; 
  65. if (is_year()) { 
  66. echo '<li>' . get_the_time('Y') . '</li>'; 
  67. if (is_attachment()) { 
  68. if (!empty($post->post_parent)) { 
  69. echo "<li><a href='" . get_permalink($post->post_parent) . "'>" . get_the_title($post->post_parent) . "</a></li>"; 
  70. echo "<li>" . get_the_title() . "</li>"; 
  71.  
  72. echo "</ul>";