Title: Search.php not loading for custom post types
Last modified: August 20, 2016

---

# Search.php not loading for custom post types

 *  [madegood](https://wordpress.org/support/users/madegood/)
 * (@madegood)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/searchphp-not-loading-for-custom-post-types/)
 * Hi,
 * I have a custom search template on my site and under some circumstances it works
   perfectly;
 * [search working well](http://www.madegood.org/?cat=9%2C8&s=+brakes&site_section=searchlibrary-bikes)
 * However i have another search form on another part of the site which search for
   custom post types. In this instance, search.php does not load and it reverts 
   to index.php.
 * [displaying correct results, but not using the right template](http://www.madegood.org/?s=+n16&post_type[]=topic&post_type[]=reply&site_section=searchforums-bikes)
 * Now I know there are potentially a couple of variables here, but I’m preeeety
   sure search.php only loads when custom post type is NOT requested.
 * If you think it would help then I could upload the contents of my search.php,
   but I feel that’s not necessary because it isn’t even being called. My feeling
   is this is a template hierarchy issue, but I don’t know how to solve it.
 * Any help greatly appreciated, I’ve spent ages on this already!

The topic ‘Search.php not loading for custom post types’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [madegood](https://wordpress.org/support/users/madegood/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/searchphp-not-loading-for-custom-post-types/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
