Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › result page › Reply To: result page
October 5, 2022 at 8:47 am
#39513
Keymaster
Please note that custom coding is not actually part of our support. I will try to answer your questions, but I can’t promise anything regarding custom code.
The redirection to the results page (when assigned to a new window) is handled by a function. Maybe if you try to override that, it may actually work:
add_action('wp_footer', 'asp_add_footer_script_2', 9999);
function asp_add_footer_script_2() {
?>
<script>
(function($){
WPD.ajaxsearchpro.helpers.openInNewTab = function(url) {
Object.assign(document.createElement('a'), { target: 'iframe1', href: url}).click();
}
}(WPD.dom))
</script>
<?php
}
For this you also have to change the redirection to a new tab: https://i.imgur.com/KrUwaGP.png
However this may not work at all.