title: Passing Query Parameters in WordPress URL
body: <p>I am successfully using the following code in my theme's functions.php file to pass a variable (page number) from a URL (in my case, this is after a mysql query which yields several hundred results): </p>
  
  <pre><code>function add_query_vars_filter( $vars ){
    $vars[] = "myvar";
    return $vars;
  }
  add_filter( 'query_vars', 'add_query_vars_filter' );
  </code></pre>
  
  <p>and then the following to use the variable:</p>
  
  <pre><code>global $wp_query;
  if (isset($wp_query-&gt;query_vars['myvar']))
  {
  $myvar= urldecode($wp_query-&gt;query_vars['myvar']);
  }
  </code></pre>
  
  <p>As a beginner, my question is: how do I edit each of these blocks of code to create and use multiple variables (e.g., myvar2, myvar3, etc.)? Not only do I need to pass a page number, but I need to pass search parameters from the mysql query which are input by the user via forms). I could experiment (as I just did), but for a beginner, messing around with my theme's function.php file and then having the entire site crash requiring me to edit via file manager is a bit nerve-racking.</p>