fbpx

Just in case anyone is looking for a way to create a search form that provides selectable drop-down list of their custom post types, here is what worked for me:

<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
	<input type="text" name="s" id="s" value="Enter keywords ..." 
        onfocus="if(this.value==this.defaultValue)this.value='';" 
        onblur="if(this.value=='')this.value=this.defaultValue;"/><br />
	<select name="post_type">
		<option value="">Choose Category:</option>
		<option value="">All Categories</option>
		<option value="post_type_a">Post Type A</option>
		<option value="post_type_b">Post Type B</option>
		 <option value="post_type_c">Post Type C</option>
	</select><br />
	<input type="submit" id="searchsubmit" value="Search Help" />
</form>