Forums

Ordering categories (2 posts)

  1. bsolah
    Member
    Posted 3 years ago #

    I'm about to edit all of my categories but I want to alter the way they're displayed in posts so that child categories follow their parents.

    i.e. Writing: Editing, Research, Politics: War, Racism

    ..at the moment they seem to be ordered based on what data I added the category.

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    If you use the the_category to display categories then you can use the parents argument of multiple. Example

    <?php the_category(', ','multiple') ?>

    Just as a note, by WordPress standards, ANY category that has been designated a Parent category is not meant to be checked in the category hierarchy when writing posts. Meaning, only the latest generation category should be checked. Think of it like this, only the youngest generation gets the action.

    It's okay to have multiple categories assigned a post, as long as the other categories are not designated as parents.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags