Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › search results link like filters
This topic contains 21 replies, has 2 voices, and was last updated by dilsecreativo 4 years, 1 month ago.
- AuthorPosts
- February 25, 2020 at 3:13 pm #25988
Hi,
Did you watch the video?- This reply was modified 4 years, 1 month ago by dilsecreativo.
February 25, 2020 at 3:58 pm #25994Oh okay, I understand now fully, thanks for the video. It should be pretty simple, I would do it like this:
Best,add_filter( 'asp_results', 'asp_change_result_uri', 10, 4 ); function asp_change_result_uri($results, $search_id, $is_ajax, $args) { foreach ( $results as $k => &$r ) { $link_parts = explode('?', $r->link); $r->link = 'http://localhost/oviedoincluye/directorio/?' . $link_parts[1]; } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 25, 2020 at 4:07 pm #25995🙂 Perfect now it works
Thank you very very much.
One more things.
How I can limit this function or the filter to apply just to that search form or that page.I have multiple search form on the site for different things and I want this filter to be applied only on [wd_asp id=6] or the directorio page.
Thankyou
February 25, 2020 at 4:10 pm #25996You are welcome. Using the $search_id variable it is possible as well:
Best,add_filter( 'asp_results', 'asp_change_result_uri', 10, 4 ); function asp_change_result_uri($results, $search_id, $is_ajax, $args) { if ( $search_id == 6 ) { foreach ( $results as $k => &$r ) { $link_parts = explode('?', $r->link); $r->link = 'http://localhost/oviedoincluye/directorio/?' . $link_parts[1]; } } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 25, 2020 at 4:19 pm #25997I love you mate 🙂
Thankyou very very muchFebruary 25, 2020 at 4:20 pm #25998You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 25, 2020 at 4:24 pm #25999ok I will rate it with the maximum level of stars.
Don’t close it please because I am configuring now the filter and I am having some difficulty. I will try by myself a bit more and if I don’t get what I want I will ask to you again
- AuthorPosts
You must be logged in to reply to this topic.