Skip to content

Instantly share code, notes, and snippets.

@jazzsequence jazzsequence/cs_searchform.php Secret
Created Jan 16, 2015

Embed
What would you like to do?
passes post_type as an array to the query string
<?php
?>
<form action="<?php echo home_url(); ?>" id="topsearchform" method="get">
<fieldset class="topsearchform">
<label for="s" class="screen-reader-text"><?php _e('Search for:', 'curated'); ?></label>
<input type="search" id="s" name="s" placeholder="" required />
<input type="hidden" name="post_type[]" value="post" />
<input type="hidden" name="post_type[]" value="song" />
<input type="hidden" name="post_type[]" value="artist" />
<input type="image" id="searchsubmit" alt="<?php _e('Search', 'curated'); ?>" src="<?php echo get_template_directory_uri(); ?>/images/searchicon.png" class="searchicon" />
</fieldset>
</form>
@jazzsequence

This comment has been minimized.

Copy link
Owner Author

commented Jan 16, 2015

this is the search page template that shows these search results https://gist.github.com/jazzsequence/5a2e82f9db8b29366ba3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.