URL Redirection

This topic contains 2 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 7 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9615
    chrisreeves
    chrisreeves
    Participant

    Hello,

    I am trying to set up the redirect feature so that search results redirect as follows:

    Standard result url:
    http://fdf.crctesting.com/product/vortex-vx-3-fluid-assist-3/

    Required result (but not working):
    http://fdf.crctesting.com/product/vortex-vx-3-fluid-assist-3/?support

    However I cannot get it to work. Please can you let me know what I am doing wrong.

    PS – I love this plugin!

    Thank you.

    #9616
    chrisreeves
    chrisreeves
    Participant

    WEB URL I Entered is wrong!!!

    Should be: fdf.crct….. not pdf.crct……

    #9617
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Thank you for your kind words!

    I’m assuming you want to change the URL of the results to include the “?support” query as well. There is no option for that unfortunately, but it’s possible to do it with a custom hook:

    Put this code to the functions.php file in your active theme directory:

    add_filter( 'asp_results', 'asp_add_support_query', 1, 1 );
     
    function asp_add_support_query( $results ) {
      foreach ($results as $k=>$v) {
        // Modify the results URL
        $results[$k]->link  .= "?support";
      }
      return $results;
    }

    That should hopefully do the trick.

    Best,
    Ernest Marcinko

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


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.