Skip to content
Permalink
Browse files

Add crumbs function

  • Loading branch information...
Quy committed Feb 22, 2019
1 parent 51b3f7a commit 9626ffbb3c3433b70e76c9b7a06b9b0c18c07222
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 9626ffb

Please sign in to comment.
You can’t perform that action at this time.