custom post types – How to specify a template for a path like http://example.com/something?

Question

I created a custom post type (‘explore’) that we use in the site. The pages for this section live at http://example.com/explore/page-name

These pages work just fine, but if a user were to back out of that url and go to http://example.com/explore they are getting the generic index.php page that is NOT what we want people to see here.

Considering this url does NOT point to any content, how can I specify which template to use? I can echo out the get_post_type() and it shows 'explore' as the post type, but I’m seeing that from the index.php template.

I tried adding a page-explore.php but that didn’t work. There doesn’t seem to be a index-[custom-type].php

Thanks.

0
Scott 1 year 2022-01-28T11:55:12-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse