How To Build Category Pages That Display Subcategories In A Loop

Written by the Divi Engine Documentation Team

Introduction

Follow these steps to build category pages through the Divi Theme builder that display desired subcategories in a loop with a filter.

Preview

Description

How to create category pages that display associated subcategories.

Difficulty

Medium.

Time

25 Minutes.

Step 1: Set It Up - Categories & Subcategories

Start off by creating your post type categories and subcategories. Then assign relevant posts.

1.) Create categories and subcategories.

2.) Assign each post to the correct category and subcategory.

Step 2: Set It Up - Theme Builder Layout

Head over to the Divi Theme Builder and create a specific post type category layout assigned to a specific category. After doing this, build a custom layout by adding the Archive Loop Module and Filter Post Module.

1.) Create a specific post type category layout then add the Filter Posts Module and Archive Loop Module.

Step 3: Customize Settings - The Archive Loop Module

Customize the Archive Loop Module by setting Post Type, Custom Loop Layout and your subcategory URLs separated by commas. By including certain subcategories in the Archive Loop Module, you will force only certain subcategories to display.

1.) Select your Post Type.

2.) Assign your Custom Loop Layout.

Step 4: Customize Settings - The Filter Posts Module

Customize the Filter Posts Module by setting what you would like to search/filter, Post Type and the category display mode.

1.) Set what you would like to filter/search as Category.

2.) Assign your Post Type.

3.) Select Sub Categories of Current Category as the display mode. (as you have this on the category archive page template, it will look for all sub categories of this one)

Step 5: Add Custom Code

No custom code here.

Step 6: Conclusion

View your category pages from the frontend.

More Support?

Please email us at [email protected] if you are unable to get Divi Machine working.


Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.