Skip Navigation

[Resolved] I would like to use the themdefault archive . php for a Custom Post Type Archive

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by andrewF-6 4 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1723935

Tell us what you are trying to do?
I would like to use the default archive.php for a Custom Post Type Archive

How can I assign the default archive.php to my custom post type archive? Currently there is a button to "Create Archive" and the following text above the button with a burgundy caution triangle: "There is no WordPress Archive for News."

I would like it to display my theme's default archive.php in this area so I do not need to make a content template for my archive.

Thanks

#1723965

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andrew,

Thank you for getting in touch.

Given that you haven't created a custom archive for this CPT then it will display automatically using the default archive.php template.

Thanks,
Shane

#1723995

Dear Shane,

That is the problem. We are using KadenceWP theme and it is not being displayed with the default archive.php theme.

Furthermore, archive.php does not show up anywhere on the Toolset Dashboard archive section.

Is there a way to manually point my Toolset archive to a specific archive.php file in the instance that the theme is not designed to standard?

Thx

#1724065

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andrew,

There isn't a way to tell toolset which theme archive.php file to use as it will default to the default one that your theme has.

Is it that your theme has a custom way of displaying their archive and you want to apply it to your custom post type?

If so then you can try creating a copy of that file and then rename the file to archive-{post_type}.php where post_type is the slug of your CPT.

https://developer.wordpress.org/themes/template-files-section/custom-post-type-template-files/

Please let me know if this helps.
Thanks,
Shane

#1724139

Hi Shane,

1. That is exactly right - we would like to take the existing archive.php and apply it to my CPT Archive. My question is in order for toolset to access this newly renamed CPT (archive-[post_type}.php, where would I locate the newly renamed file? What directory would I put it in?

2. The other issue I am having is by default before you create an archive in the toolset dashboard, it should be default display archive.php - in my installation with the Kadence theme it does not display this and nor does the default archive display in the same way as the theme's actual default archive.php. That is why I was asking how to point the theme to the default archive.php.

Any thoughts?

Thanks so much.

#1724149

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Andrew,

1. That is exactly right - we would like to take the existing archive.php and apply it to my CPT Archive. My question is in order for toolset to access this newly renamed CPT (archive-[post_type}.php, where would I locate the newly renamed file? What directory would I put it in?

This file will be placed in the same directory as the original archive.php file.

2. The other issue I am having is by default before you create an archive in the toolset dashboard, it should be default display archive.php - in my installation with the Kadence theme it does not display this and nor does the default archive display in the same way as the theme's actual default archive.php. That is why I was asking how to point the theme to the default archive.php.

Unless Kadence made a special archive.php template then that is different from the default then you will get defaulted to the archive.php

What I suspect is that in this case Kadence may have created a special archive template for their posts and this what you are seeing now is the actual default template.

Thanks,
Shane

#1769307
Toolset-Dashboard-archive-php-issue.png

Fresh install of Toolset with Kadence theme.

1. Can you please check the ability to create a content template that displays with correct formatting with the Kadence theme?
2. Can you please check how one reassigns the layout to the default archive (archive.php) with Kadence theme?

The attached image shows the issue we are having.