I'm trying to do a category page where it displays a card layout with the sub-categories of that wordpress category.

Basically i would have "Sports" and inside the page multiple cards with the Categories "basketball" "football" etc...(oof course these are just example categories).

I know how to build the cards etc... i just cant find the php function to fetch all the sub cateogires for example when we are fetching the articles of one category

<?php if ( have_posts() ) : ?>                    
                    <?php while ( have_posts() ) : the_post(); ?>

I'm looking for something similar, because all the solutions i have found are for e comerce plug ins and dont work...

thanks in advance!

1 Answer 1


Have you tried looking in the Wordpress docs?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.