• echozone

    (@echozone)


    For a way to put a link to specific categories in the sidebar, I’m using
    <?php echo(get_category_parents(1,TRUE,'')); ?>

    which works great since none of the categories are nested.
    Previously, I was hard coding them.
    This is the only tag referenced in the codex that does what I wanted.
    Is this the best way to do this?

Viewing 1 replies (of 1 total)
  • I have a lot of categories in my blog. When once I wanted to link to some single category, I can’t use wp_list_cats because that means I have to exclude lots of other categories, which is too complex. So the way you posted here was exactly what I did. Using the id of that category itself as the input parameter for get_category_parent makes my life a lot easier. Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘using get_category_parents for single category links’ is closed to new replies.