How to display child categories on archive page of parent categories
Apr 19, 2025 pm 11:54 PMDo you want to know how to display child categories on the parent category archive page?
When you customize a classification archive page, you may need to do this to make it more useful to your visitors.
In this article, we will show you how to easily display child categories on the parent category archive page.
Why do subcategories appear on parent category archive page?
By displaying all child categories on the parent category archive page, you can make them less generic and more useful to visitors.
For example, if you run a WordPress blog about books and have a taxonomy called "Theme", you can add sub-taxonomy such as "novel", "non-fiction" so that your readers can easily sort your books.
When you have a lot of content, this not only makes it easier for you to stay organized, but it also helps your visitors find relevant content faster.
For more details on using taxonomy, see the guide on how to create custom taxonomy in WordPress.
That being said, let's show you how to display child categories on the parent category archive page.
Show child categories on parent category archive page
This tutorial requires some basic understanding of how to add code to WordPress. For more details, see our beginner's guide to pasting web clips into WordPress.
Then, you need to find the classification template file for your WordPress theme. It is usually named with a similar name taxonomy-{taxonomyname}.php.
If you create a custom taxonomy called "Books", the name will be taxonomy-books.php. If you don't have this file, you need to create it first.
To learn more, see our WordPress Template Hierarchy cheat sheet to help find the categorical theme template files you need to edit.
Once you find the correct classification template file, you just need to add the following code to where you want to display the list:
Note how it simply lists all sub-taxonomy of single parent taxonomy. In this case, it shows the different book topics that exist in our parent category.
For more details on custom classification pages, see our guide on how to display current classification titles, URLs, and more in WordPress.
We hope this article helps you understand how to display child categories on the parent category archive page. You might also want to check out our guide on the differences between domain names and web hosting and our expert picks of the best GoDaddy alternatives.
The above is the detailed content of How to display child categories on archive page of parent categories. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Contents 1. What is ICN? 2. ICNT latest updates 3. Comparison and economic model between ICN and other DePIN projects and economic models 4. Conclusion of the next stage of the DePIN track At the end of May, ICN (ImpossibleCloudNetwork) @ICN_Protocol announced that it had received strategic investment in NGPCapital with a valuation of US$470 million. Many people's first reaction was: "Has Xiaomi invested in Web3?" Although this was not Lei Jun's direct move, the one who had bet on Xiaomi, Helium, and WorkFusion

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest version of Binance is 2.101.8, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest official version of the virtual currency trading platform v6.129.0 is a professional and secure digital asset trading application created for Android users. It provides rich market conditions, convenient trading functions and multiple security protection, and is committed to providing users with a first-class trading experience.

As the market conditions pick up, more and more smart investors have begun to quietly increase their positions in the currency circle. Many people are wondering what makes them take decisively when most people wait and see? This article will analyze current trends through on-chain data to help readers understand the logic of smart funds, so as to better grasp the next round of potential wealth growth opportunities.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.
