Table of Contents
Why do subcategories appear on category page?
How to display subcategories on the category page of WordPress
Home CMS Tutorial WordPress How to display subcategories on the category page of WordPress

How to display subcategories on the category page of WordPress

Apr 20, 2025 am 07:18 AM
wordpress Why 2025

Do you want to display subcategories on the category page of WordPress?

WordPress makes it easy for you to organize your posts using categories and subcategories. You can help visitors navigate subcategories more easily by displaying them on the category page.

In this article, we will show you how to display subcategories on the category page of WordPress.

How to display subcategories on the category page of WordPress

Why do subcategories appear on category page?

When you write posts for your WordPress website, you can optimize your search engines and improve your website navigation by correctly categorizing your content. This will bring more traffic to your website and make it easier for visitors to find what they are looking for.

On some websites, it makes sense to use subcategories to simplify the structure of a website.

For example, you might have a top (parent) category called "Sports". You can then create subcategories under Sports called NFL, NBA, and MLB.

How to display subcategories on the category page of WordPress

When your visitors click on the Sports category, they will see each post in the Sports category and its subcategory. However, they won't see a list of subcategories. This makes it hard to filter to NFL or NBA posts.

Showing a list of subcategories on the category page can improve site navigation. This is especially true if you decide to hide subcategories in the Category Widget of your website.

How to display subcategories on the category page of WordPress

For example, visitors to your website can easily transfer from all sports posts to NFL-only. Even better, you can continue to display the same subcategories on the NFL page so that they can easily switch from NFL to NBA.

That being said, let's see how to display subcategories on the category page of WordPress.

How to display subcategories on the category page of WordPress

To display subcategories on the category archive page, you need to add the code to the topic file. If you need help adding code to your website, see our beginner's guide on how to paste web snippets into WordPress.

The first thing you need to do is go into the theme folder and look for a name called category.php.

If you don't see the file, you have to create it. Just copy archive.php and name it category.php.

Note : If your theme does not contain category.php or archive.php, you may be using the WordPress theme framework and you must create category.php manually. A great starting point for learning how to create archive files is our guide on how to create custom archive pages in WordPress.

Now, just add the following code before the category.php loop:

How to display subcategories on the category page of WordPress

Now when you visit the category page, you will see a list of subcategories.

On our demo website, the Sports Categories page displays links to the NFL, NBA, and MLB subcategories.

How to display subcategories on the category page of WordPress

After clicking the NFL link, you will be on the NFL subcategory page.

Here you can still see links to the sports subcategories, so you can easily switch between different types of sports. This can really simplify navigation on your website.

How to display subcategories on the category page of WordPress

We hope this tutorial helps you learn how to display subcategories on the category page of WordPress. You may also want to learn how to improve your website's SEO or our expert picks of the best WordPress popup plugins.

The above is the detailed content of How to display subcategories on the category page of WordPress. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1655
14
PHP Tutorial
1254
29
C# Tutorial
1228
24
What does cross-chain transaction mean? What are the cross-chain transactions? What does cross-chain transaction mean? What are the cross-chain transactions? Apr 21, 2025 pm 11:39 PM

Exchanges that support cross-chain transactions: 1. Binance, 2. Uniswap, 3. SushiSwap, 4. Curve Finance, 5. Thorchain, 6. 1inch Exchange, 7. DLN Trade, these platforms support multi-chain asset transactions through various technologies.

Ranking of exchanges in low-cost fees in 2025 Ranking of exchanges in low-cost fees in 2025 Apr 22, 2025 am 06:21 AM

The exchange with the lowest handling fee in the currency circle is Binance, with a spot trading rate of 0.1%. 1. Binance: The spot transaction fee rate is 0.1%, and BNB deduction fee is supported. 2. OKX: The spot transaction fee rate is 0.02%-0.15%, suitable for high-frequency trading. 3. Gate.io: The spot transaction fee rate is 0.2%, and the coin is listed quickly.

Shiba INU (Shib) and Mutuum Finance (MUTM) are key assets Shiba INU (Shib) and Mutuum Finance (MUTM) are key assets Apr 21, 2025 pm 09:30 PM

An investor with a $170 million portfolio considers ShibaInu (SHIB) and MutuumFinance (MUTM) to be key assets in building generational wealth. ShibaInu benefits from growing interest in meme coins, while MutuumFinance is an emerging structured lending project with rapid pre-sales progress. Let's dive into the dynamics of these two crypto assets this week. ShibaInu: Long-term holders dominate ShibaInu's price fell 11% this week, but its long-term growth rate is as high as 123%, and the current trading price is $0.0001139. Technical analysts point out that the cryptocurrency is on the rebound trend line and is

Sesame Open Door Official Website Entrance Sesame Open Door Official Latest Entrance 2025 Sesame Open Door Official Website Entrance Sesame Open Door Official Latest Entrance 2025 Apr 28, 2025 pm 07:51 PM

Sesame Open Door is a platform that focuses on cryptocurrency trading. Users can obtain portals through official websites or social media to ensure that the authenticity of SSL certificates and website content is verified during access.

Top 10 inventory of foreign mainstream currency exchanges (updated in 2025) Top 10 inventory of foreign mainstream currency exchanges (updated in 2025) Apr 22, 2025 am 06:51 AM

The top 10 foreign mainstream currency exchanges include: 1. Binance, the world's largest, with leading trading volume and number of users; 2. Coinbase and Kraken, suitable for European and American users, compliant and safe; 3. OKX and Huobi, more popular in the Asian market; 4. Bybit, providing high-leverage contracts, suitable for derivative trading; 5. KuCoin and Gate.io, launching new products quickly, supporting niche currencies.

Ouyi official website entrance Ouyi official latest entrance 2025 Ouyi official website entrance Ouyi official latest entrance 2025 Apr 28, 2025 pm 07:48 PM

Choose a reliable trading platform such as OKEx to ensure access to the official entrance.

Ancoin Registration Tutorial for Beginners Tutorial 2025 Ancoin Exchange Registration Tutorial Latest Version Ancoin Registration Tutorial for Beginners Tutorial 2025 Ancoin Exchange Registration Tutorial Latest Version Apr 24, 2025 pm 12:12 PM

2025 Ancoin Exchange Registration Tutorial: Prepare your email and password, visit the official website to register, complete KYC verification, set 2FA and trading password to recharge and start trading.

The latest list of recommended cryptocurrency trading platforms (updated in 2025) The latest list of recommended cryptocurrency trading platforms (updated in 2025) Apr 22, 2025 am 07:12 AM

The recommended cryptocurrency trading platforms in 2025 include: 1. OKX, which ranks first with its technical strength and global operations; 2. Binance, which leads in the number of users and transaction volume; 3. Gate.io, which has a rich currency and low transaction fees; 4. Huobi Global, which has a stable user base; 5. Kraken, which is known for its security and compliance; 6. Coinbase, which focuses on compliance; 7. KuCoin, which has strong innovation and community interaction; 8. Crypto.com, which has a strong brand influence; 9. Bitfinex, which is the first choice for professional traders; 10. MEXC Global, which has fast transaction speed and low fees.

See all articles