WordPress.org

Ready to get started?Download WordPress

Forums

How to get a list of subcategories from one category (1 post)

  1. Joshaw
    Member
    Posted 7 months ago #

    Hi,

    At the moment I have some jQuery which I have used to create a category filter on some of my category pages.

    The pages are categorised according to country (using a category-$country-slug.php template).
    I want to filter the posts shown on these pages by subcategories from the parent category 'resort-types'.

    To add the categories as classes onto each post I have used:
    <li class="<?php the_category_unlinked(' '); ?>">
    <!--post here-->

    which gives me all the 'resort-type' categories I want but also givse me the 'country' category.

    How can I get a list of the subcategories to put in the class of each post? All I can find is how to get an

  2. list but I just want a simple text list with spaces (e.g. class="family-friendly advanced budget")

    Any suggestions/advice would be greatly appreciated!

    Thanks

    Jo

Reply

You must log in to post.

About this Topic

Tags

No tags yet.