Solution:2
WordPress automatically strips out parameters it doesn’t recognise before it builds your pages. The solution is to trick WordPress into accepting your parameters as though they were integral to the framework. I couldn’t find an ‘official’ wordpress plugin to allow me to do this, but came across this solution (credits below)….
You will need to edit the template file which loads the page you want to receive the parameter, and you will need to upload some code as a plugin to name the variable(s) that you want to use, but it seems to work well.
Here is the plugin code, which needs to get uploaded to your plugins folder and activated….
<?php
/* Plugin Name: Parameter
Plugin URI: http://webopius.com/
Description: A plugin to allow parameters to be passed in the URL and recognized by WordPress
Author: Adam Boyse
Version: 1.0
Author URI: http://www.webopius.com/
*/
add_filter('query_vars', 'parameter_queryvars' );
function parameter_queryvars( $qvars )
{
$qvars[] = 'yourvarname';
return $qvars;
}
?>
…and here is an example of how to use it in your template page….
global $wp_query;
if (isset($wp_query->query_vars['yourvarname']))
{
print $wp_query->query_vars['yourvarname'];
}
You need to change yourvarname to the name of the variable your page expects to receive.