Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active May 9, 2019 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wplit/cee1588f9a1c812c155940c4d036bd59 to your computer and use it in GitHub Desktop.
Save wplit/cee1588f9a1c812c155940c4d036bd59 to your computer and use it in GitHub Desktop.
search form for custom post type
<form role="search" method="get" id="searchform" class="searchform" action="https://yoursite.com/">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="" name="s" id="s">
<input type="hidden" value="product" name="post_type" />
<input type="submit" id="searchsubmit" value="Search">
</div>
</form>
@wplit
Copy link
Author

wplit commented May 9, 2019

Put inside code block in the html bit.

Change line 1 to include your site URL as action
Change line 5 to include your post type as value (replace 'product')

@wplit
Copy link
Author

wplit commented May 9, 2019

it's the same html as normal Oxygen component puts out, just added line 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment