Skip to content

Commit

Permalink
enhance(crumb): Add child categories to breadcrumb (Fixes #4) (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Jul 29, 2023
1 parent bdb3a40 commit 82ce124
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Crumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ public function build()
$categories = get_the_category(get_the_ID());

if (! empty($categories)) {
$category = array_shift($categories);

$this->add(
$category->name,
get_category_link($category),
$category->term_id,
true
);
foreach ($categories as $index => $category) {
$this->add(
$category->name,
get_category_link($category),
$category->term_id,
$index === 0
);
}

return $this->add(
get_the_title(),
Expand Down

0 comments on commit 82ce124

Please sign in to comment.