• The following code:

    <?php echo(get_category_parents($cat, TRUE, ' &raquo; ')); ?>

    as stated on the function reference should output this:

    Internet » Blogging » WordPress »

    The problem is i’m getting only:

    Internet »

    and it will not display childs of that category…

    where could I be wrong ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Do the categories definately have posts?

    Thread Starter patunfo

    (@patunfo)

    yes, there are posts in each category.

    Childs of categories are correctly displayed by the wp_list_categories

    This function is contextual, so Internet » is all you will get if you are on the Internet category page, while you should get Internet » Blogging » WordPress » when you are on the WordPress category page.

    Thread Starter patunfo

    (@patunfo)

    ok I solved the problem, the problem was with the $cat 🙂

    i had to put

    <?php $cat = get_the_category(); $cat = $cat[0]; ?>

    before

    <?php echo(get_category_parents($cat, TRUE, ' &raquo; ')); ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘get_category_parents question’ is closed to new replies.