WordPress.org

Support

Support » Themes and Templates » category-slug.php sub-category problem

category-slug.php sub-category problem

  • I’v created a theme file ‘category-events.php’ and its working great for listing all of the posts in the events category. But if I want to see a specific type of event (which is a sub-category) then WordPress defaults to my ‘category.php’.

    For example:
    ‘siteurl.com/category/events’ uses ‘category-events.php’
    but
    ‘siteurl.com/category/events/music’ uses ‘category.php’

    Googling around I found some old solutions to similar problems dealing with using the category id, but I was wondering if there’s anything better now that WordPress supports category slug template files.

  • The topic ‘category-slug.php sub-category problem’ is closed to new replies.