The Ultimate Guide to Display a Category Page in WordPress

When it comes to organizing the content for the website, it is crucial to make proper use of categories and tags. The category proves effective to group your content, develop a logical site structure, and offer great reading experiences to your visitors. This enhances the usability and accessibility of your sites, which are indispensable elements for the success of a web online business.

Another important element is the category page, serving as an index of all posts that belong to a particular subject. 

Understanding what a category page is and how to display it will facilitate your business development, increase conversions as well as enhance your overall SEO.

Let’s get to know the category page first!

Category Page: An Essential Piece of an Online Marketing Strategy

In simple words, the category page lists all posts that are assigned to one category or multiple categories. It means that this page helps the site owner to group posts having a similar topic together and make locating content-related posts easier.

There are 2 main reasons why you should capture full capabilities of category pages:

  1. To improve the Search Engine Optimization of your website: Your category archive page will work as a landing page appearing when readers search for topic-related keywords or phrases. Since it provides natural traffic for your website and gives it a chance to captivate targeted traffic, your overall domain authority is boosted considerably. Additionally, you can achieve a higher ranking from Google thanks to your decent and clear structure.
  2. To improve the user experience: With the category page, you encourage visitors to read more posts in the same category they are interested in. It also comes in useful when visitors want to navigate to other posts on your site. On top of that, when using Google Analytics to identify which category gains the most popularity, you should put more effort to improve the content of the posts in that category page. 

How to Improve SEO of Your Site and Overall User Experience with Category Page

When we talk about category page and its capability, the category itself, its slug, description, and subcategory should be taken into consideration. Since the category and its slug take important parts in leveraging your website’s marketing opportunities, you need to keep in mind some guides:

  • Make sure you use a clear, descriptive and content-related category name, such as “Films”, “Music” instead of “Other forms of entertainment”.
  • Cover a large expanse of your blog posts with broad categories. 

In addition to the category on your website, the separate category description is an interesting and significant feature that you should take full advantage of. Using a category description not only enhances your readers’ reading experiences but also makes the category clearer and more informative.

The subcategory is usually known as the child category which is narrower than the parent category. For example, you have a main category named Business. Then you divide this parent category by going more in-depth into groups such as Sales, Marketing, etc.

Applying and showing subcategories help you boost the SEO of your website and provide better browsing experiences of visitors who can easily navigate to the different types of content.

How to Display the Category Page

A category page can include posts from a single category or multiple categories. Let’s follow our guide to display two kinds of the category page in WordPress.

#1 Display a page featuring posts from a single category

Viewing directly

When a category is created, WordPress will automatically generate a page including posts from that category. In order to display that page, you just need to do some simple steps:

  1. Go to Posts → Categories
  2. Navigate to Categories, then click View under your desired category

 

categorypage_view

 

categorypage_view1

When you click View, a category page will appear and you can get a direct link of this page. However, you will see the category base in your URLs, which causes difficulty in getting a higher Google ranking. There is a simple way to remove category on a slug in archive page link: 

  1. Go to Settings → Permalinks
  2. Choose Custom Structure
  3. Add /%category%/%postname%/ after your domain
  4. Enter “.” to Category base

category_permalinks

Showing in menu and sidebar

There are 2 steps to show the category page in menu and sidebar:

  1. Assign posts to categories.First, you locate Posts and choose the post that you want to add to a category. On the right, you will see Category options. Just click on your desired category and Update your change.
  2. Display the category page in navigation menus and widget

Remember this: before displaying categories in the menu, you have to make sure that these categories have posts filed under them.

In menus, go to Appearance → Menus, select categories and click Add to Menus.

categorypage_menus

In the sidebar, go to Appearance → Widgets, then choose the categories that you want to appear in the sidebar and click Add Widget.

categorypage_widget

When you want to show subcategories in the sidebar, drag and drop categories to a Sidebar. Then check the box next to Show hierarchy in categories widget’s settings and click Save.

#2 Display a page featuring posts from multiple categories

Besides the page showing posts from a specific category, you may want to display posts on a page from multiple categories. Installing Advanced Custom Fields Pro (ACF Pro) plugin is an ideal option. After installing and activating ACF Pro, let’s follow these steps to display the page:

  1. Go to Pages → Add New
  2. Enter the name of this page (It should be a broader name)
  3. Locate Display Posts
  4. Select your favorite categories and set the number of posts in each category.
  5. Click Add Rowcategorypage_acp

How to Display Category Description on the Category Archive Page

Category descriptions are usually automatically displayed on the category archive pages. However, since sometimes your theme doesn’t support this feature, you need to take further steps to edit your theme files.

  1. Connect to your WordPress site using an FTP (File Transfer Protocol) client
  2. Go to /wp-content/themes/your-current-theme/ folder
  3. Navigate to category.php file and edit it. In case your theme doesn’t have that file, you have to edit the archive.php file
  4. Copy and paste the code below
<?php

the_archive_description( '<div class="taxonomy-description">', '</div>' );

?>

How to Display Subcategory on the Category Archive Page

What if the category has subcategories and you want to display a list of all sub or child categories on the parent archive page?

Let’s copy and paste this code to your archive.php file!

if (is_category()) {

$this_category = get_category($cat);

}

?>

<?php

if($this_category->category_parent)

$this_category = wp_list_categories('orderby=id&show_count=0

&title_li=&use_desc_for_title=1&child_of='.$this_category->category_parent.

"&echo=0"); else

$this_category = wp_list_categories('orderby=id&depth=1&show_count=0

&title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID.

"&echo=0");

if ($this_category) { ?>

<ul>

<?php echo $this_category; ?>

</ul>

<?php } ?>

Wrapping up

In terms of category, category pages are extremely beneficial for not only users to get what they are looking for quickly but also the website owner to keep a website coherent. 

Knowing what a category page is and how to display it in the menu with different forms is essential for every site owner.

With the growth of your blog content, you should take category pages to a whole new level by using them to improve the SEO of your website and enhance the reading experiences of your audiences. 

In order to optimize a category page, it is necessary to use appropriate category name, remove the term “category” from the WordPress URLs and consider showing category description as well as subcategories along with it. 

Have any questions about the category page? Please leave a comment in the box below!

Leave a Reply

Your email address will not be published. Required fields are marked *