search results link like filters

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 dilsecreativo 4 years, 1 month ago.

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #25988
    dilsecreativo
    dilsecreativo
    Participant

    Hi,
    Did you watch the video?

    • This reply was modified 4 years, 1 month ago by dilsecreativo dilsecreativo.
    #25994
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh okay, I understand now fully, thanks for the video. It should be pretty simple, I would do it like this:

    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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #25995
    dilsecreativo
    dilsecreativo
    Participant

    🙂 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

    #25996
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome. Using the $search_id variable it is possible as well:

    
    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;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #25997
    dilsecreativo
    dilsecreativo
    Participant

    I love you mate 🙂
    Thankyou very very much

    #25998
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #25999
    dilsecreativo
    dilsecreativo
    Participant

    ok 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

Viewing 7 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic.