Support » Fixing WordPress » Using categories as crumbtrail whilst excluding a category

Viewing 1 replies (of 1 total)
  • Thread Starter trixienolix

    (@trixienolix)

    bit of a bump here…

    I found this code:

    <div class="breadcrumbs"> <?php $cat = get_the_category(); $cat = $cat[0]; ?>
    <?php echo(get_category_parents($cat, TRUE, ' &raquo; ')); ?>
    </div>

    which is great EXCEPT that some of my posts are in 3 categories (as per above) and it sometimes shows the parent / child category and sometimes shows just the single category. This behaviour seems to depend on the alphabetical order of the categories i.e. it shows the parent cat and the subcat one but only if the subcat is alphabetically lower down than another cat who has no subcat.

    Any ideas? I need to be able to exclude a category from get_category_parents
    this is an attempt at it but it was never fully answered and so doens’t work:
    http://stackoverflow.com/questions/5807819/exclude-category-from-get-category-parents-wordpress

Viewing 1 replies (of 1 total)
  • The topic ‘Using categories as crumbtrail whilst excluding a category’ is closed to new replies.