π Software keys sent via WhatsApp or E-mail within 24 hours (1 Day) ! β³ If not received, Contact us! ! π¬![]()
Live Search does not require SearchWP but will use it if available
Live Search does not require SearchWP but will use it if available
Rs4,018.00 Original price was: Rs4,018.00.Rs410.00Current price is: Rs410.00. for 1 year
Live Search does not require SearchWP but will use it if available
Live Search enhances your search form by applying an AJAX search, allowing you to see search results without needing to redirect to a results page. Designed to work with any theme and any SearchWP configuration, Live Search is the easiest way to quickly improve your search forms!
Live SearchΒ does not require SearchWP, soΒ it is available on wordpress.org. If you have SearchWP installed and activated, Live Search will automatically utilize it. If you donβt, native WordPress search results will be provided.
After uploading and activating Live Search, any form generated usingΒ get_search_form()Β will be automatically enhanced with live search using the default configuration. The default SearchWP search engine will be used (or WordPress native search if SearchWP isnβt available) and the default theme applied. You canΒ customize everything to a great degree, however.
If you are not usingΒ get_search_form()Β you can simply add a data attribute to enable live search, like so:
| <?php | |
| // if your form is generated using get_search_form() you do not need to do this | |
| // as SearchWP Live Search does it automatically out of the box | |
| ?> | |
| <form action=”” method=”get“> | |
| <p> | |
| <label for=”s“><?php _e( ‘Search’ , ‘mytextdomain’ ); ?></label> | |
| <input type=”text” name=”s” id=”s” value=”” data-swplive=”true” /> <!– data-swplive=”true” enables SearchWP Live Search –> | |
| </p> | |
| <p> | |
| <button type=”submit“><?php _e( ‘Search’ , ‘mytextdomain’ ); ?></button> | |
| </p> | |
| </form> |
If you would like to prevent SearchWP from automatically enabling live search on forms generated with get_search_form(), use theΒ searchwp_live_search_hijack_get_search_formΒ filter.
You may customize the search engine used by setting theΒ data-swpengineΒ attribute on your input field to match the search engine name you would like to use. This only applies when SearchWP is installed and activated, and takes precedence over theΒ engineΒ defined in the applicable config.
You may customize the config used per search form by setting theΒ data-swpconfigΒ attribute on your input to match an array key from the configs array. To customize these use theΒ searchwp_live_search_configsΒ filter.
Live Searchβs results are powered by a template system. Youβll notice that there is a file that ships with the plugin:Β ~/wp-content/plugins/searchwp-live-ajax-search/templates/search-results.php. This file is used to display search results.Β It is recommendedΒ that if you wish to customize the search results you take the following steps:
searchwp-live-ajax-searchsearch-results.phpΒ from theΒ ~/wp-content/plugins/searchwp-live-ajax-search/templates/Β directory into that foldersearch-results.phpΒ as you would any theme templatesearch-results-supplemental.phpΒ for a search engine namedΒ supplementalLive Search outputs some basic styles to properly position the results wrapper. It also outputs a default, minimal theme of sorts. You can remove the default visual styling while retaining the positioning by dequeueing the default theme CSS:
| <?php | |
| function my_remove_searchwp_live_search_theme_css() { | |
| wp_dequeue_style( ‘searchwp-live-search’ ); | |
| } | |
| add_action( ‘wp_enqueue_scripts’, ‘my_remove_searchwp_live_search_theme_css’, 20 ); |
?Β NOTE:Β The default themeΒ alsoΒ implements the spinner animation If you are removing the default theme you will need to add the below keyframe animation to your themeβs CSS.
| @keyframes searchwp-spinner-line-fade-quick { | |
| 0%, 39%, 100% { | |
| opacity: 0.25; | |
| } | |
| 40% { | |
| opacity: 1; | |
| } | |
| } |
If you would like to also remove the positioning CSS, you can do that using theΒ searchwp_live_search_base_stylesΒ filter.
You can reposition the results container in two ways:
data-swpparentel=".masthead .my-search-results-parent"parent_elΒ property to the configuration (seeΒ searchwp_live_search_configs)The following filters are available for use in Live Search:
searchwp_live_search_hijack_get_search_form
Set whether Live Search will automatically enhance search forms generated byΒ get_search_form(). Default isΒ true, to disable:
| <?php | |
| add_filter( ‘searchwp_live_search_hijack_get_search_form’, ‘__return_false’ ); |
searchwp_live_search_get_search_form_engine
Define the search engine to be used when automatically enabling live search on forms generated byΒ get_search_form(). Default isΒ 'default'.
Note: only applicable with SearchWP installed and activated
| <?php | |
| // only applies when SearchWP is active | |
| function my_searchwp_live_search_get_search_form_engine() { | |
| return ‘my_supplemental_engine’; | |
| } | |
| add_filter( ‘searchwp_live_search_get_search_form_engine’, ‘my_searchwp_live_search_get_search_form_engine’ ); |
searchwp_live_search_get_search_form_config
Define the config to be used when automatically enabling live search on forms generated byΒ get_search_form(). Default isΒ 'default'.
Note: only applicable with SearchWP installed and activated
| <?php | |
| // only applies when SearchWP is active | |
| function my_searchwp_live_search_get_search_form_config)() { | |
| return ‘my_config’; | |
| } | |
| add_filter( ‘searchwp_live_search_get_search_form_config’, ‘my_searchwp_live_search_get_search_form_config’ ); |
searchwp_live_search_configs
Add your own configurations, which control settings for which search engine to use, search delay, minimum characters, results pane positioning, and spinner options. Configs are stored as an associative array, so you can optionally override the values in theΒ defaultΒ key, or add your own and use them when setting theΒ data-swpconfigΒ attribute on your search input.
This is the default configuration:
Note:Β the minimum character default is 3 (which is the same as SearchWP itself) but configuration settings for Live Search areΒ separateΒ parameters and are not updated when similar SearchWP parameters have been customized.
| <?php | |
| $configs = array( | |
| ‘default’ => array( // ‘default’ config | |
| ‘engine’ => ‘default’, // search engine to use (if SearchWP is available) | |
| ‘input’ => array( | |
| ‘delay’ => 500, // wait 500ms before triggering a search | |
| ‘min_chars’ => 3, // wait for at least 3 characters before triggering a search | |
| ), | |
| ‘parent_el’ => ‘body’, // selector of the parent element for the results container | |
| ‘results’ => array( | |
| ‘position’ => ‘bottom’, // where to position the results (bottom|top) | |
| ‘width’ => ‘auto’, // whether the width should automatically match the input (auto|css) | |
| ‘offset’ => array( | |
| ‘x’ => 0, // x offset (in pixels) | |
| ‘y’ => 5 // y offset (in pixels) | |
| ), | |
| ), | |
| ‘spinner’ => array( // Powered by http://spin.js.org/ | |
| ‘lines’ => 13, // The number of lines to draw | |
| ‘length’ => 38, // The length of each line | |
| ‘width’ => 17, // The line thickness | |
| ‘radius’ => 45, // The radius of the inner circle | |
| ‘scale’ => 1, // Scales overall size of the spinner | |
| ‘corners’ => 1, // Corner roundness (0..1) | |
| ‘color’ => ‘#ffffff’, // CSS color or array of colors | |
| ‘fadeColor’ => ‘transparent’, // CSS color or array of colors | |
| ‘speed’ => 1, // Rounds per second | |
| ‘rotate’ => 0, // The rotation offset | |
| ‘animation’ => ‘searchwp-spinner-line-fade-quick’, // The CSS animation name for the lines | |
| ‘direction’ => 1, // 1: clockwise, -1: counterclockwise | |
| ‘zIndex’ => 2e9, // The z-index (defaults to 2000000000) | |
| ‘className’ => ‘spinner’, // The CSS class to assign to the spinner | |
| ‘top’ => ‘50%’, // Top position relative to parent | |
| ‘left’ => ‘50%’, // Left position relative to parent | |
| ‘shadow’ => ‘0 0 1px transparent’, // Box-shadow for the lines | |
| ‘position’ => ‘absolute’ // Element positioning | |
| ), | |
| ) | |
| ); |
You can change the values of these defaults, or append your own separated configs and have multiple configs available to you:
| <?php | |
| function my_searchwp_live_search_configs( $configs ) { | |
| // override some defaults | |
| $configs[‘default’] = array( | |
| ‘engine’ => ‘default’, // search engine to use (if SearchWP is available) | |
| ‘input’ => array( | |
| ‘delay’ => 400, // wait 500ms before triggering a search | |
| ‘min_chars’ => 5, // wait for at least 3 characters before triggering a search | |
| ), | |
| ‘parent_el’ => ‘body’, // selector of the parent element for the results container | |
| ‘results’ => array( | |
| ‘position’ => ‘bottom’, // where to position the results (bottom|top) | |
| ‘width’ => ‘auto’, // whether the width should automatically match the input (auto|css) | |
| ‘offset’ => array( | |
| ‘x’ => 0, // x offset (in pixels) | |
| ‘y’ => 5 // y offset (in pixels) | |
| ), | |
| ), | |
| ‘spinner’ => array( // Powered by http://spin.js.org/ | |
| ‘lines’ => 13, // The number of lines to draw | |
| ‘length’ => 38, // The length of each line | |
| ‘width’ => 17, // The line thickness | |
| ‘radius’ => 45, // The radius of the inner circle | |
| ‘scale’ => 1, // Scales overall size of the spinner | |
| ‘corners’ => 1, // Corner roundness (0..1) | |
| ‘color’ => ‘#ffffff’, // CSS color or array of colors | |
| ‘fadeColor’ => ‘transparent’, // CSS color or array of colors | |
| ‘speed’ => 1, // Rounds per second | |
| ‘rotate’ => 0, // The rotation offset | |
| ‘animation’ => ‘searchwp-spinner-line-fade-quick’, // The CSS animation name for the lines | |
| ‘direction’ => 1, // 1: clockwise, -1: counterclockwise | |
| ‘zIndex’ => 2e9, // The z-index (defaults to 2000000000) | |
| ‘className’ => ‘spinner’, // The CSS class to assign to the spinner | |
| ‘top’ => ‘50%’, // Top position relative to parent | |
| ‘left’ => ‘50%’, // Left position relative to parent | |
| ‘shadow’ => ‘0 0 1px transparent’, // Box-shadow for the lines | |
| ‘position’ => ‘absolute’ // Element positioning | |
| ), | |
| ); | |
| // add an additional config called ‘my_config’ | |
| $configs[‘my_config’] = array( | |
| ‘engine’ => ‘supplemental’, // search engine to use (if SearchWP is available) | |
| ‘input’ => array( | |
| ‘delay’ => 300, // wait 500ms before triggering a search | |
| ‘min_chars’ => 2, // wait for at least 3 characters before triggering a search | |
| ), | |
| ‘results’ => array( | |
| ‘position’ => ‘top’, // where to position the results (bottom|top) | |
| ‘width’ => ‘css’, // whether the width should automatically match the input (auto|css) | |
| ‘offset’ => array( | |
| ‘x’ => 0, // x offset (in pixels) | |
| ‘y’ => 0 // y offset (in pixels) | |
| ), | |
| ), | |
| ‘spinner’ => array( // Powered by http://spin.js.org/ | |
| ‘lines’ => 13, // The number of lines to draw | |
| ‘length’ => 38, // The length of each line | |
| ‘width’ => 17, // The line thickness | |
| ‘radius’ => 45, // The radius of the inner circle | |
| ‘scale’ => 1, // Scales overall size of the spinner | |
| ‘corners’ => 1, // Corner roundness (0..1) | |
| ‘color’ => ‘#ffffff’, // CSS color or array of colors | |
| ‘fadeColor’ => ‘transparent’, // CSS color or array of colors | |
| ‘speed’ => 1, // Rounds per second | |
| ‘rotate’ => 0, // The rotation offset | |
| ‘animation’ => ‘searchwp-spinner-line-fade-quick’, // The CSS animation name for the lines | |
| ‘direction’ => 1, // 1: clockwise, -1: counterclockwise | |
| ‘zIndex’ => 2e9, // The z-index (defaults to 2000000000) | |
| ‘className’ => ‘spinner’, // The CSS class to assign to the spinner | |
| ‘top’ => ‘50%’, // Top position relative to parent | |
| ‘left’ => ‘50%’, // Left position relative to parent | |
| ‘shadow’ => ‘0 0 1px transparent’, // Box-shadow for the lines | |
| ‘position’ => ‘absolute’ // Element positioning | |
| ), | |
| ); | |
| return $configs; | |
| } | |
| add_filter( ‘searchwp_live_search_configs’, ‘my_searchwp_live_search_configs’ ); |
searchwp_live_search_base_styles
Set whether the default results pane positioning CSS is applied.Β NOTE:Β this is separate from the visual appearance of the search results and controlsΒ onlyΒ positioning. Default isΒ true, to disable:
| <?php | |
| add_filter( ‘searchwp_live_search_base_styles’, ‘__return_false’ ); |
searchwp_live_search_posts_per_page
Control how many results are returned. Default isΒ 7, to change:
| <?php | |
| function my_searchwp_live_search_posts_per_page() { | |
| return 20; // return 20 results | |
| } | |
| add_filter( ‘searchwp_live_search_posts_per_page’, ‘my_searchwp_live_search_posts_per_page’ ); |
Only logged in customers who have purchased this product may leave a review.
No account yet?
Create an Account
Reviews
Clear filtersThere are no reviews yet.