Leave a Reply

3 comments

  1. Solved using this code.

    add_filter( 'category_link','append_parameter', 10, 2 );
    
    function append_parameter( $link, $my_parameter ) {
    $my_parameter = $_GET['sort']; //get sort value       
    if ( isset($my_parameter) ) { 
        $link = add_query_arg( 'sort', $my_parameter, $link );
    }
        return $link;
    }
    
  2. You could use this:

    <?php
    $myvar = $_GET['myvar'];
    ?>
    

    and to make sure, u could also put this code in any page to test it:

    <?php
    echo $myvar;
    ?>
    

    This is simply the $GET[] function in PHP.

    I hope it helps, and for more info visit this website.