I declared a custom post type. I can add new, save and display my cpt and it’s meta data. This all works nicely.
When declaring my cpt I set
‘taxonomies’ => array(‘category’),
I then added some categories manually and assigned specific cpt posts to those categories.
The categories in this example are all 50 states.
When I go to http://domain.com/category/rhode-island/ I only get results for regular posts that are in the category, however all cpt’s have been excluded.
These results are built by the template page archive.php
All attempts to do archive-cpt-name.php have failed but I am not concerned with this at the moment.
If I perform a search within the category my cpt’s show so for example http://domain.com/category/rhode-island/?s=a will show all posts and cpt’s with the letter “a”.
I have been able to search more specifically and pull up just cpt results as well.
The search results are powered by the search.php template which is an exact duplicate of the archive.php.
My main question here is what would keep the custom post type posts from showing in archive/category results but allow them to be searched with in that category?
- The topic ‘Custom Post Type Taxonomy Issue’ is closed to new replies.