Forum Replies Created
-
AuthorPosts
-
Ernest Marcinko
KeymasterHi!
It’s a bit hard to tell only by a screenshot – but as first suggestion I would recommend trying different variations for these options: https://i.imgur.com/nFF6jt2.png
Those options are usually the culprit if something is not showing up as it should.Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
Thank you very much for the details! Indeed, this should be doable with a small custom code snippet.
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.
add_action('wp_footer', 'asp_add_footer_script', 99999); function asp_add_footer_script() { ?> <script> jQuery(function($){ $('input.orig').one('click', function(e){ $(this).get(0).dispatchEvent(new Event('input')) }); }); </script> <?php }If you need help with this just let me know!
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterSure, I think it’s still doable.
Please try this variation instead:
add_action('wp_footer', 'asp_add_footer_script', 99999); function asp_add_footer_script() { ?> <script> jQuery(function($){ $('.asp-try a').on('click', function(e){ $(this).closest('.asp_w_container').find('.promagnifier').trigger('click'); }); }); </script> <?php }Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
Thanks for the details!
Currently I see an article carousel on the page, do you mean restricting search to those items?
Ernest Marcinko
KeymasterHi,
While there is no option to do that, it should be doable via a bit of custom code to trigger a redirection.
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.
add_action('wp_footer', 'asp_add_footer_script', 99999); function asp_add_footer_script() { ?> <script> jQuery(function($){ $('.asp-try a').on('click', function(e){ let id = $(this).closest('.asp_w_container').data('id'); ASP.api(id, 'hideResults'); ASP.api(id, 'searchRedirect', jQuery(this).text()); }); }); </script> <?php }September 15, 2023 at 4:08 pm in reply to: Prohibit searching with empty search term and taxonomies #45398Ernest Marcinko
KeymasterHi,
For the filters there are options to do that here: https://i.imgur.com/0iwGFOI.png
For the search input there is no such feature, however you can set the minimum character count to trigger from 0 to 1 or higher here: https://i.imgur.com/baosD8O.png
Unfortuantely that is not going to display a message. However with that the search is not triggering so you don’t need to abort. Then you could hook an event listener and check for the length with for example:jQuery('.asp_m input.orig').val().lengthErnest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterYou cannot access this content.
Ernest Marcinko
KeymasterHi,
Yes!
For the post types, if you don’t select anything in the Search Sources panel, they will appear unchecked by default. It’s a hacky way until we implement the option to set the states in the future.
For the tags, you can do it here.
Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts