Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
For that there is indeed no setting as of yet – but it should be easily doable via a small custom code snippet via the javascript API.
For that, I constructed this small snippet, which hooks into the container when the results are displayed and to sends a
no_resultsevent with the search phrase in the “phrase” property, when detects 0 results:add_action( 'wp_footer', function () { ?> <script> document.querySelectorAll(".asp_main_container").forEach((el) => { el.addEventListener("asp_results_show", (event) => { // event.detail carries the arguments const [id, instance, phrase] = event.detail; const zeroResults = document.querySelectorAll('.asp_r_' + id + '_' + instance + ' .item').length === 0; const noresContainerVisible = document.querySelectorAll('.asp_r_' + id + '_' + instance + ' .asp_nores').length > 0; if ( zeroResults || noresContainerVisible ) { // This is the GTAG event that is sent gtag('event', 'no_results', { 'phrase': phrase, }); } }); }); </script> <?php }, 9999 );Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
If you need any help with this, just le me know!
Ernest Marcinko
KeymasterYou cannot access this content.
July 10, 2025 at 8:00 am in reply to: Input Search Field Won’t Focus After Click Magnifying Glass – 2.0 #54886Ernest Marcinko
KeymasterYea, sure!
It seems like it has something to do with the dialog, perhaps something with the settings, but I’m not sure. It’s part of Elementor, so you probably don’t want to disable that. I can’t tell if it’s the core script or something hooking into it though, most likely hook somewhere, but that’s impossible to find.
What I found though is that this script should get around it, I just tested and it worked from the console:
add_action('wp_footer', function () { ?> <script> const f = ( select = false ) => { let input = document.querySelector('.dialog-widget .asp_m input.orig'); if ( input === null ) { return; } input.focus(); if ( select ) { input.setSelectionRange(0, 9999); } } jQuery(document).on('elementor/popup/show', ()=>{ setTimeout(()=>{f(true);}, 800); document.querySelectorAll(".asp_main_container").forEach((el) => { el.addEventListener("asp_search_end", () => { setTimeout(()=>{f();}, 500); }); }); }); </script> <?php }, 999999);Ernest Marcinko
KeymasterYou cannot access this content.
July 9, 2025 at 10:42 am in reply to: Query Loop block pagination breaks after using search/filter #54874Ernest Marcinko
KeymasterMy guess is within 2 weeks. This is surely going to be addressed, but it is still very much possible that it can’t be done, live paginations/load more features are generally a huge issue after live queries.
July 9, 2025 at 10:39 am in reply to: Input Search Field Won’t Focus After Click Magnifying Glass – 2.0 #54873Ernest Marcinko
KeymasterThanks!
Turns out that is not caused by anything, but it is a recent change in Apple IOS mobile devices. I have found this topic about it.
Basically it is not possible to focus an input box programmatically after a timeout or asynchronous request on any iPhone within the latest IOS versions. I couldn’t find out why is that, but it is limited by the device and not by a script or the browser.
July 9, 2025 at 7:03 am in reply to: Query Loop block pagination breaks after using search/filter #54870Ernest Marcinko
KeymasterHi,
Thank you for all the details!
Unfortunately this is not accidental. At the moment there is no way to not reload the page as the event handlers on the pagination can’t be reattached so it defaults back into normal pagination.
I have raised an issue about this on our issue tracker. I’m working on some other features right now, but I marked it to the next release milestone. I think I have a polyfill solution for a similar issue with Elementor, will check if it can be applied to the query loop as well.
-
This reply was modified 11 months ago by
Ernest Marcinko.
Ernest Marcinko
KeymasterYou cannot access this content.
July 8, 2025 at 7:04 am in reply to: Input Search Field Won’t Focus After Click Magnifying Glass – 2.0 #54862Ernest Marcinko
KeymasterHi Dan,
Sure, I can try. Can you please turn off asset minification, as right now every single script is delegated to some sort of a nitro CDN, so I can’t tell what the original source is.
Without that I might be able to pinpoint by blocking scripts one by one and then check the script file source.Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterOh, and I forgot to add, the live results (which pop-up when entering something) can be customized, for that use the advanced title and content fields feature.
Ernest Marcinko
KeymasterHi Stephane!
The results page layout is a theme feature, search plugins can’t change that. Most themes however have wide support for customizing the layout and fields displayed via theme editor features (such as Divi or Avada). The best and easiest way therefore to check the theme builders integrated with your theme, 99% of the time it’s possible.
Another possibility is to use a full featured page editor, such as Elementor. With page editors can replace the whole results page with their own loops that you can customize.
The 3rd possibility is to edit the theme files via a child theme. This I only recommend when none of the options above are available or possible. In your case it shouldn’t be too difficult actually. If I understand correctly you want to only replace the excerpt with an ACF text field of some sort?
If your theme doesn’t support customizations and page building is not available, I can take a look if you want to. For that however I will need temporary sFTP and back-end access as some file edits will be required for sure. Also, don’t forget the field name, I need that too in order to fetch it programmatically 🙂 -
This reply was modified 11 months ago by
-
AuthorPosts