Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › A Quick help is needed
- This topic has 53 replies, 2 voices, and was last updated 4 years, 9 months ago by
daro201370.
-
AuthorPosts
-
August 18, 2021 at 2:38 pm #34305
daro201370
ParticipantYou cannot access this content.
August 18, 2021 at 3:14 pm #34306Ernest Marcinko
KeymasterSure!
Can you please add temporary access and FTP details? I want to make sure this is not related to the plugin somehow. When the override is inactive, it should not affect anything at all, it is only a simple redirection to the results page, so it should not cause any issues whatsoever.
August 19, 2021 at 9:44 am #34309daro201370
ParticipantYou cannot access this content.
August 19, 2021 at 10:04 am #34310Ernest Marcinko
KeymasterThanks Thon!
It seem to work all right on that site, when I disable the search override feature, so this might be related to something else as well unfortunately.
One last thing you can try on the live site via a custom code:
add_action('wp_footer', 'wp_footer_asp_custom_redirect', 9999); function wp_footer_asp_custom_redirect() { ?> <script> (function($){ let url = 'https://www.khmeradverts.com/'; $('input.orig').on('keydown', function(e){ let keycode = e.keyCode || e.which; if ( keycode == 13 ) { e.preventDefault(); e.stopPropagation(); location.href = url + '?s=' + $(this).val() + '&category=&location=&a=true'; } }); $('.promagnifier').on('click touchstart', function(e){ e.preventDefault(); e.stopPropagation(); location.href = url + '?s=' + $(this).closest('.asp_m').find('input.orig').val() + '&category=&location=&a=true'; }); })(jQuery); </script> <?php }This will completely prevent any return key or input actions when doing the search, and only does a redirection there. Try adding this code 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 this does not work, then there is something else conflicting there.
August 19, 2021 at 10:30 am #34311daro201370
ParticipantYou cannot access this content.
August 19, 2021 at 11:21 am #34312Ernest Marcinko
KeymasterIt should work for sure. I can not see the custom code however in the page source – make sure to clear all layers of cache so it is populated to the front-end.
August 19, 2021 at 11:50 am #34313daro201370
ParticipantYou cannot access this content.
August 19, 2021 at 11:54 am #34314Ernest Marcinko
KeymasterYou cannot access this content.
August 19, 2021 at 1:18 pm #34315daro201370
ParticipantYou cannot access this content.
August 19, 2021 at 1:34 pm #34316Ernest Marcinko
KeymasterYou cannot access this content.
August 19, 2021 at 3:07 pm #34317daro201370
ParticipantYou cannot access this content.
August 19, 2021 at 3:48 pm #34318Ernest Marcinko
KeymasterYou cannot access this content.
August 20, 2021 at 12:28 am #34319daro201370
ParticipantYou cannot access this content.
August 20, 2021 at 8:55 am #34320Ernest Marcinko
KeymasterCan you try now? I made the direct modification via the admin panel. The working code is:
add_action('wp_footer', 'wp_footer_asp_custom_redirect', 9999); function wp_footer_asp_custom_redirect() { ?> <script> (function($){ let url = 'https://mwqh53re.club/'; function reattach() { $('input.orig').off(); $('input.orig').on('keydown', function(e){ let keycode = e.keyCode || e.which; if ( keycode == 13 ) { e.preventDefault(); e.stopPropagation(); location.href = url + '?s=' + $(this).val() + '&category=&location=&a=true'; } }); $('.promagnifier').off(); $('.promagnifier').on('click touchstart', function(e){ e.preventDefault(); e.stopPropagation(); location.href = url + '?s=' + $(this).closest('.asp_m').find('input.orig').val() + '&category=&location=&a=true'; }); } reattach(); setTimeout(function(){ reattach(); }, 100); setTimeout(function(){ reattach(); }, 1000); })(jQuery); </script> <?php }August 20, 2021 at 12:34 pm #34322daro201370
ParticipantYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.