Permalink
Browse files

Add crumbs function

  • Loading branch information...
Quy committed Feb 3, 2019
1 parent 44d1c81 commit 9c8f6f2c70a7a978ce97d067efac4086c28f150e
Showing with 21 additions and 0 deletions.
  1. +21 −0 include/functions.php
@@ -574,6 +574,27 @@ function generate_page_title($page_title, $p = null)
}
//
// Generate breadcrumb navigation
//
function generate_crumbs($crumbs)
{
$last_key = end(array_keys($crumbs));
$crumbs_markup = '<ol class="crumbs">';
foreach ($crumbs as $idx => $crumb)
{
$crumbs_markup .= '<li>'.($idx ? '<span>»&#160;</span>' : '');
$item = is_array($crumb) ? '<a href="'.$crumb[1].'">'.$crumb[0].'</a>' : $crumb;
$crumbs_markup .= $idx == $last_key ? '<strong>'.$item.'</strong>' : $item;
$crumbs_markup .= '</li>';
}
$crumbs_markup .= '</ol>';
return $crumbs_markup;
}
//
// Save array of tracked topics in cookie
//

0 comments on commit 9c8f6f2

Please sign in to comment.