Search form for custom post type with pretty permalinks
-
Hi,
I’m having trouble creating a custom search form for my custom post type. The custom post type is ‘products’.
I have singled down the default search so that it only searches the post type ‘post’.
However, when I try to create my custom search form for my products post type, it only works when I’m on default permalinks. When I go into custom permalinks like
/%category%/%postname%/
it defaults my search back to the default one, and therefore doesn’t show me my custom post type.
What I have put in my custom search form to search custom post types, is
<input type="hidden" value="products" name="post_type">
I hope that makes sense.
- The topic ‘Search form for custom post type with pretty permalinks’ is closed to new replies.