Forums

When displaying the category of a post, how would I... (5 posts)

  1. kelp
    Member
    Posted 2 years ago #

    show both the subcategory and the category, like Mouse--Food, this shows both the parent and child category. Instead, my website shows just Food.

  2. MichaelH
    moderator
    Posted 2 years ago #

    Might want to look at Template_Tags/get_category_parents.

  3. kelp
    Member
    Posted 2 years ago #

    Thanks very much!

  4. kelp
    Member
    Posted 2 years ago #

    I'm having some troubles with this. Here's the code I'm using:
    '
    <div class="post-date"><?php the_time('F jS, Y') ?> in <?php echo(get_category_parents($cat, TRUE, ' » ')); ?></div>
    '

    Here's what displays in the source code:
    '
    <div class="post-date">January 31st, 2007 in » </div>
    '

    It basically just comes up with a >>, and that's all. Did I input the code wrong?

  5. gingersnaps
    Member
    Posted 2 years ago #

    My template does not show the category at each post. Is there a way to make that happen?

    (If so, I would need step by step directions, because I am a novice to all of this...)
    Thanks!!!

Topic Closed

This topic has been closed to new replies.

About this Topic