WordPress.org

Ready to get started?Download WordPress

Forums

Show only sub-category (child) posts (1 post)

  1. kurtbogdon
    Member
    Posted 1 year ago #

    Hello. I'm trying to create a template that will show only the posts related to a sub-category. Here is an example:

    Category = Cars
    Sub-category = Buick
    Sub-category = Ford
    Sub-category = Jeep

    I would like to change the category.php file so that if I click on a link for "Jeep" I will only see the posts for "Jeep".

    I have tried many different variations on the_category, is_child_of_category, get_the-category, etc, and viewed all the relevant posts I could find, but nothing will work.

    What I have now just shows all the posts in the parent category.

    Many thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags