WordPress is removing all unknown (not registered) $_GET
parameters while processing the request (same is true for $_POST
).
You can either register the custom variable, or just go the canonical PHP way by using filter_input()
. This will access the original, unchanged GET
parameters.
If you are using filter_input()
, you have to hook into pre_get_posts
to change the fetched resource.
You can also filter query_vars
and register your custom variable here. This will make sure it is preserved.
add_filter( 'query_vars', function ( $vars ) {
$vars[] = 'sereno';
return $vars;
});
Then you can access it per get_query_var( 'sereno' )
now. You still have to change the request somehow if you want to show some custom content.