Trouble Displaying a Parent Category
-
I have quite a few categories on my site, so they’re structured using sub categories. Here’s an example of how my site works…
Food – Dinner – Drinks – Iced Tea (“Iced Tea” would be a post)I’d like to only show Dinner & Drinks and not “Food”. I’ve tried using a couple of other pieces of code, but no luck. The below code is what’s been the best so far. Any help would be greatly appreciated.
<?php $breadcrumbs = explode('|',get_category_parents($cat,true,'|')); array_pop($breadcrumbs); array_pop($breadcrumbs); if ($breadcrumbs) foreach ($breadcrumbs as $crumb) echo ' / '.$crumb; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Trouble Displaying a Parent Category’ is closed to new replies.