gaspi
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [SearchAutocomplete] Loading JS and styles only when it's necessaryHi, thanks for the help. If anybody interested, here is how i set it in the theme’s functions.php to enable script depending on post id:
add_action('wp_enqueue_scripts', 'autocomplete_only_on_postID'); function autocomplete_only_on_postID() { global $post; $post_id = $post->ID; if ( $post_id == XX ) { return false; // enable scripts } else { return true; // disable scripts } } add_filter( 'search_autocomplete_disable_frontscripts', 'autocomplete_only_on_form' );Forum: Plugins
In reply to: [SearchAutocomplete] Loading JS and styles only when it's necessaryHi. Just saw you updated your plugin so i tried to disable loading scripts you mentioned in the previous post but with no success. Could you show me an example? Where and how to add filter to disable script loading? It has to be added to the template?
Thank you in advance!
Forum: Plugins
In reply to: [SearchAutocomplete] Loading JS and styles only when it's necessaryI see. Thanks for the great news 🙂
Forum: Plugins
In reply to: [SearchAutocomplete] Loading JS and styles only when it's necessaryThank you for your reply, i tried to make it work but no success, only errors. I also tried to make something similiar like this, but still, no success. Could you help me out how to achieve this?
Viewing 4 replies - 1 through 4 (of 4 total)