Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
A sample implementation of a SearchWP search form and corresponding results loop using the Shortcodes extension
<h3>Search Form</h3>
[searchwp_search_form engine="my_test_engine" target="http://example.com/supplemental-search/" var="searchvar" button_text="Find Results"]
<div class="search-results-wrapper">
[searchwp_search_results engine="my_test_engine" var="searchvar" posts_per_page=2]
<h2>[searchwp_search_result_link direct="true"]</h2>
[searchwp_search_result_excerpt]
[/searchwp_search_results]
</div>
<div class="no-search-results-found">
[searchwp_search_results_none]
No results found, please search again.
[/searchwp_search_results_none]
</div>
<div class="search-results-pagination">
[searchwp_search_results_pagination direction="prev" link_text="Previous" var="searchvar" engine="my_test_engine"]
[searchwp_search_results_pagination direction="next" link_text="Next" var="searchvar" engine="my_test_engine"]
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment