Create custom post archive for Divi theme

Spread the love
  • 3

What is the Custom Post Archive?

It’s the way that WordPress follows to display your custom post entries when you visit your custom post archive page.


Duplicate your Divi’s index.php to archive-{posttype_slugname}.php

Remember, it’s recommended to add it to a child theme!

How to visit your current custom post archive?

In our example, we have a custom post called ‘Catalog’ created by ‘Types‘ plugin. And our permalink setting is set to ‘Post name‘. So when we need to visit our custom post archive, we go to

To create a custom post archive in Divi theme:

In Divi theme, the custom post archive is been displayed using template file: index.php

1- Locate index.php in your Divi theme files and make a copy of it.

Please note, it’s highly recommended to create a child theme and move that file to it. If you don’t have a child theme for Divi, you can get DiviColt for free. It’s a minimal Divi child theme.

2- Rename that copy to archive-{posttype_slugname}.php, in our example it would be archive-catalog.php
3- Start editing your newly created file, Divi will use this file to display your catalog (custom post) posts.

Not using Divi?

So what! The same can be done with any other WordPress theme following these steps:

1- Create new PHP file and name it archive-{posttype_slugname}.php
2- Start editing that file, basic template should be something like this:

READ  The Best WordPress Page Builder

3- Once you’re done, upload that file to your theme’s directory (remember the child theme, learn how to create one in 2 minutes), then WordPress will display your custom posts using the template you just created.
More about custom archives

(Visited 3,156 times, 1 visits today)
  • 3

Mohamed Khafaja

WordPress enthusiast, who loves to share the knowledge!

risus. Sed Aliquam ut Curabitur nunc vulputate, justo dictum

Pin It on Pinterest

Do you find this interesting?

Share it with your friends!