Descriere
Relevanssi Live Ajax Search enables ajax live search for your search forms. It won’t swamp you with settings, and generally, Relevanssi Live Ajax Search works without any modifications necessary. If you want to customize it, you have complete control over how it works and what it does.
Relevanssi Live Ajax Search displays the search results using templates. You can easily override the default templates from your theme to make the results look the way you want them to look.
Funcționează foarte bine cu Relevanssi
Relevanssi Live Ajax Search only provides you with live search results. To get really good results, use Relevanssi, Relevanssi Premium or Relevanssi Light. Relevanssi Live Ajax Search automatically uses Relevanssi to power the search results if Relevanssi is installed and active. However, you don’t need Relevanssi; Relevanssi Live Ajax Search also works with the default WP search.
Modificări de la SearchWP Live Ajax Search
Relevanssi Live Ajax Search is a fork of SearchWP Live Ajax Search. I forked it from version 1.6.1 because it looked like SearchWP Live Ajax Search wasn’t getting updates anymore. I also wanted to improve the Relevanssi compatibility.
Relevanssi Live Ajax Search drops all SearchWP compatibility. You can use SearchWP Live Ajax Search, which has built-in SearchWP support.
The widget has also been removed. It was unnecessary and outdated.
Relevanssi Live Ajax Search can now take over the Gutenberg core/search
search form.
Acest modul este pe GitHub
Feel free to open up issues at
https://github.com/msaari/relevanssi-live-ajax-search.
Instalare
- Install the plugin from the WordPress plugin screen.
- Activează modulul.
- Gata! De cele mai multe ori, asta este tot ce ai nevoie.
If Relevanssi Live Ajax Search does not automatically attach itself to your search form, you can enable it by adding a single HTML5 data attribute (data-rlvlive="true"
) to the input field of your search form. You can find more information in the plugin documentation.
Întrebări frecvente
-
Cum creez un șablon personalizat pentru rezultatele de căutare
-
Relevanssi Live Ajax Search uses a template loader, making it easy to replace the search results. There is a
templates
folder in the plugin folder, which includessearch-results.php
. This file is the template used to output search results. To customize the search results:- Create a folder called
relevanssi-live-ajax-search
in your theme directory. - Copiază fișierul
search-results.php
în dosarul nou. - Relevanssi Live Ajax Search va utiliza acum acel fișier pentru a afișa rezultatele.
If you want to override the default CSS styles, you can remove them this way:
add_filter( 'relevanssi_live_search_base_styles', '__return_false' );
Acest cârlig de filtrare înlătură stilurile de bază care controlează poziția rezultatului de căutare live.
wp_dequeue_style( 'relevanssi-live-search' );
Asta înlătură stilurile actuale pentru rezultatele de căutare.
- Create a folder called
-
I’m using Astra, Storefront, or Divi, and this plugin doesn’t work
-
It does, Astra search form is just designed in a way that hides the search results. You can find solutions in the plugin documentation. The easiest solution is adding this to your theme
functions.php
:add_filter( 'relevanssi_live_search_add_result_div', '__return_false' );
-
Vreau să modific numărul de rezultate afișate
-
There’s a filter for that! Add this to your theme functions.php or in a code snippet:
add_filter( 'relevanssi_live_search_posts_per_page', function() { return 10; } );
Va arăta 10 rezultate. Poți să ajustezi numărul așa cum vrei.
-
Folosesc WPML și nu obțin niciun rezultat!
-
For some reason, the combination of Relevanssi Live Ajax Search, Relevanssi and WPML leads to problems. To solve this problem, use the
WP_Query
mode of fetching the results. To activate the mode, add this to your theme functions.php:add_filter( 'relevanssi_live_search_mode', function() { return 'wp_query'; } );
This will make Relevanssi Live Ajax Search use a different method of fetching the results. This method is compatible with WPML. This method uses the
search-results-query.php
template instead of the defaultsearch-results.php
template in Relevanssi Live Ajax Search, so take note if you want to customize the template to use the right base template for your customization.
Recenzii
Contributori și dezvoltatori
„Relevanssi Live Ajax Search” este un software open-source. La acest modul au contribuit următoarele persoane.
Contributori„Relevanssi Live Ajax Search” a fost tradus în 12 locale. Mulțumim traducătorilor pentru contribuția lor.
Tradu „Relevanssi Live Ajax Search” în limba ta.
Te interesează dezvoltarea?
Răsfoiește codul, vezi depozitarul SVN, sau abonează-te la jurnalul de dezvoltare prin RSS.
Istoric modificări
2.5
- Security update: if used with the default WP search, this plugin could be used to see private post titles. This is no longer possible. With Relevanssi, this has never been a problem.
2.4
- New filter hook
relevanssi_live_search_template_function
lets you override the default template function used to display the results. - Înlătură parametrul origin_id care nu mai este necesar.
- Dacă Relevanssi este activ, Live Ajax Search asigură că min_chars nu poate fi mai mic decât lungimea minimă a cuvântului în Relevanssi.
- When you remove letters from the search terms and go below the min_chars value, the results disappear instead of showing the spinner.
2.3.1
- Fixes the bugs in search results placement introduced in 2.3.
2.3
- The messages template is no longer loaded with AJAX. Instead, it is included in the JS localization. If you want to load it with AJAX, have the
relevanssi_live_ajax_search_ajax_messages
filter hook returntrue
. - If the parent element is set with the
rlv-parentel
attribute and located away from the input field, the results will be placed under the parent element and not under the input field. - If the window is resized and that makes the search form hidden, the search results will also be removed.
2.2
- The search form now also responds to the
input
event, which makes the search respond to context menu paste. - You can now override the default messages template by placing your custom template in the
relevanssi-live-ajax-search
directory in your theme. - Noul cârlig de filtrare
relevanssi_live_search_messages_template
poate fi folosit pentru a filtra șablonul de mesaje. - Cârligul de filtrare
relevanssi_live_search_get_template_part
are un parametru suplimentar pentru contextul șablonului: poate firesults
saumessages
, în funcție de șablonul care este încărcat.
2.1
- Oprește erorile la editarea unei pagini cu un bloc de căutare Gutenberg în ea.
- New parameter
static_offset
helps when the JS counts the result box offset wrong. Setting this tofalse
may solve these problems. - Fixes missing spinners: spinners only appeared in the first search form of the page.
2.0.1
- Redenumește clasa
has-spinner
înrlv-has-spinner
pentru a evita coliziunile cu alte module. - Include an updated version of spinner SCSS in the plugin instead of getting an outdated version from npm.
2.0.0
- Funcționalitatea
relevanssi_live_search_control_plugins_during_search
a fost înlăturată. - The search now uses a CSS spinner instead of the old Javascript spinner.
- Improved accessibility: the instructions for screen reader users are moved from the
aria-label
parameter to a separatespan
element that is hidden from sight.
1.2.2
- Fixes the
relevanssi_live_search_base_styles
filter hook, which was in reverse: now it works as expected and disables styles when you give itfalse
.
1.2.1
- Adds automatic hijack for WooCommerce product search form.
1.2.0
- The way this plugin uses
query_posts()
can lead to problems (for example with WPML). It is now possible to use a newWP_Query
instead, which is safer. - New filter hook
relevanssi_live_search_mode
controls which mode is used:query_posts
(the default value) is the old way, any other value uses WP_Query. - Există un nou fișier șablon
search-results-query.php
. Acest șablon este utilizat pentru metodaWP_Query
.
1.1.0
- Accesibilitate îmbunătățită: utilizatorii de cititoare de ecran primesc notificări mai bune cu privire la ceea ce se întâmplă.
- Accesibilitate îmbunătățită: locația implicită pentru rezultatele căutării este acum următoarea oprire a filei din formularul de căutare, în div#rlvlive_1.
- Removes JQuery migration deprecation warnings.
- The search results now show the total number of results found. These changes are in the default template, so if you’re using a custom template, check the default template.
- New filter hook
relevanssi_live_search_status_location
controls where the total is displayed (‘before’, ‘after’ or nowhere for any other value, in which case only the screen reader status is added). - New filter hook
relevanssi_live_search_add_result_div
controls whether an extra div is added for the results. - If Relevanssi is available, searches that find no results show ‘Did you mean’ suggestions.
1.0.0
- Prima versiune bazată pe versiunea 1.6.1 a SearchWP Live Ajax Search.