You’ll want to stick something like this in your theme’s category.php
file:
<?php
// fetch the categories with the parent being the current cat
$sub_cats = get_terms('category', array(
'parent' => get_queried_object_id()
));
if(!is_wp_error($sub_cats) && $sub_cats)
{
foreach($sub_cats as $cat)
{
// Create your grid here, this is just an example
printf(
'<a href="https://wordpress.stackexchange.com/questions/57529/%s">%s</a>',
get_term_link($cat, $cat->taxonomy),
$cat->name
);
}
}
Related Posts:
- How to get category and archive title?
- How can I create a category landing page followed by pages of posts?
- Custom permalink structure leads to be 404 on pagination
- Exclude the category from the WordPress loop
- How to make child categories recognize parent’s template displays
- How to show a category post to a specific registered user
- Get id of category from drop down menu
- How can I only show certain posts?
- Category menu item and its last 10 posts as sub-menu
- How to split the categories of subcategories with thumbnails
- Prevent function from triggering again when post in specific category gets another category?
- Add custom category name as data-filter to switch between these categories
- Get all the blog’s categories and the related URLs?
- Update taxonomy value of post type in query
- Is it possible to add short code and html tag in Category Description?
- Sort post’s categories by ID
- How do I specify more than one category?
- Set the default category of an attachment
- exclude post from displaying in loop if it is in a category, but not in many categories
- Show Featured products in product category pages
- Set post categories to include parents when setting child category
- Making a tourism information website [closed]
- How to remove category titles?
- Adding Categories Through Function
- Get only one of the current categories
- Show Available Taxonomy List with Current Category
- How to get grandparent of a given category
- WordPress search only showing a few posts
- How to recreate a copy of a product category in WooCommerce? [closed]
- Multiple category archive page
- List subcategories of active parent category (WooCommerce)
- How to display post type and category links in foreach WordPress code
- Updating category template to change how subcategories display
- Create menu / submenu from category subcategory and posts
- Add multiple classes. Different style for each category tag
- Inside a loop, how to change CSS class based on category name?
- Add a custom category page in WordPress.org
- Remove the parent name from permalink
- Make parent category an optgroup
- Randomly load categories with latest post
- Is it possible to remove from default category widget?
- WordPress alphabetical A-Z custom post type post result display
- Count category views – Is it possible?
- wp_dropdown_categories not showing option as selected
- How to check if a post belongs to a category that has only 1 posts?
- How do I use just one category’ posts on my home page?
- If x comments in a post move post to category y
- Count tags for a specific category
- wp_list_categories walker without links on categories that have subcategories (to make a nested dropdown menu)
- How can I display tags as categories?
- On the Blogpost I have categories showing, is there a way to exclude a catgegory like ‘Media’?
- Adding additional content on post depending on post categories
- Set category page title in custom theme [closed]
- Root category template?
- Posts from a category on homepage with category archieves page default css
- wp_list_categories not excluing multiple ids
- How to use wp_list_categories with plugin category?
- Custom meta boxes ID prefix showing on first category but not others
- Exclude category from foreach loop
- ID of last created category
- Theme modification for custom category menus
- Custom css per category and per single post belong in each category
- Get categories of queried posts
- Limit Loop to One Category
- wordpress taxonomy query posts
- Different header for each category
- Subcategory is displayed before Parent Category
- sidebar troubles, taxonomy trouble
- Code for Category, Tags, Archive URLs
- Duplicate new categories across multisite network
- Display all subcategories from parent category
- Custom Loop with certain number of one category
- “Special” category is displayed in all categories or show parent category on sub category
- How to show WooCommerce Categories on ‘shop’ page instead of products?
- How to list all subcategories from all categories but not from a certain category
- add woocommerce archive description if exist
- How to create Child Category page from scratch at wordpress?
- Automatically create tags and merge with categories
- Is there a reason to put a product in both the Child and Parent Categories?
- How to insert category to post via php?
- How to list all categories a post is in, but exclude current post´s category on single post page
- Get only children category name
- Show Subcategory Name Instead of Parent Category
- Get category id of next / prev post inside the_post_navigation
- No results found for second level category
- Limit Category/Tag Dropdown To blog_id in Multisite Install With Global Categories/Tags
- Media Library filter returns undefined function get_current_screen
- Custom built theme won’t filter categories
- WP_query exclude a category unless it has more than one catagory
- how to display page title only for child category pages
- category filter doesn’t work
- how to edit wp category widget
- In a url where Category Id is wrong It is showing wrong it is going to the page not found page
- how wordpress generates permalinks as /%category%/%post%/
- Only show sub-category
- Style sub categories differently from its parent category
- Link to page in category
- get_category_children/ the new get_term_children not work
- How to create a photo gallery that can be filtered by the image categories
- WordPress how to remove parent slug from category URLs