Skip to content

Instantly share code, notes, and snippets.

@nickstewart95
Created December 20, 2020 22:42
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 nickstewart95/d6f18dff97e9e7873c5b0447f3e834b5 to your computer and use it in GitHub Desktop.
Save nickstewart95/d6f18dff97e9e7873c5b0447f3e834b5 to your computer and use it in GitHub Desktop.
add_shortcode('algolia_search', function () {
//Check to see if there is a query
$query = get_search_query();
if (!empty($query)) {
//Setup Algolia
//Set search results
} else {
$searchResults = false;
}
ob_start();
//include search results template
return ob_get_clean();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment