Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created August 12, 2014 14:13
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 jchristopher/63a171417582e68d1276 to your computer and use it in GitHub Desktop.
Save jchristopher/63a171417582e68d1276 to your computer and use it in GitHub Desktop.
Output a pre-search form that uses SearchWP Live Ajax Search
<?php
// output the pre-search form
function searchwp_pre_search_form_markup() { ?>
<div class="searchwp-pre-ticket">
<h3>Create Support Ticket</h3>
<p>Begin by <strong>using a few keywords</strong> to describe your support issue:</p>
<div class="bbp-search-form" style="padding-bottom:0;">
<form role="search" method="get" id="bbp-search-form" action="https://searchwp.com/support/">
<div>
<label class="screen-reader-text hidden" for="bbp_search">Search for:</label>
<input tabindex="101" type="text" value="" name="bbp_search" id="bbp_search" data-swplive="true">
<input tabindex="102" class="button" type="submit" id="bbp_search_submit" value="Search">
</div>
</form>
</div>
<p><em>Good example:</em> <kbd>limit search results</kbd> <br />
<em>Bad example:</em> <kbd>not working</kbd></p>
</div>
<?php }
add_action( 'bbp_template_after_single_forum', 'searchwp_pre_search_form_markup' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment