Created
January 26, 2018 09:03
-
-
Save rayrutjes/0c7a7082a3d2195294d40eff88d9cc19 to your computer and use it in GitHub Desktop.
Display instantsearch on all pages in Algolia WooCommerce plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'algolia_wc_should_display_instantsearch', function( $should_display ) { | |
// If configuration already considers it should be shawn, show it. | |
if ( $should_display ) { | |
return true; | |
} | |
// Detect the current page and only return true when you want instantsearch.js to be injected. | |
if ( is_shop() ) { | |
// Only for the main shopping page. | |
return true; | |
} | |
return false; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment