How to display Category Name and conditionally Category Parent Name in Archive (1 post)

  1. here
    Posted 7 years ago #

    Hey all --

    archive.php categories.

    Two types of category archives:

    Child categories including one parent -- should display the parent and child category. This works well with get_the_category()

    Parent categories including multiple children categories -- should display only the Parent category name. I can't figure out how to use get_the_category() because it pulls a child/parent category combination from the posts and I can't test to see if the archive page is a top level category.

    A function for the archive page which tests to see if it is a parent category would work. Any ideas? Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic