I have added to my child theme functions.php:
function mychildtheme_register_query_vars( $vars ) {
$vars[] = 'papers';
return $vars;
}
add_filter( 'query_vars', 'mychildtheme_register_query_vars' );
When I try to query the var in another page
echo (get_query_var( $papers, $default='test' ));
the result is an empty string ('test' gets echoed), even if:
global $wp_query;
var_dump($wp_query->query_vars);
shows the vars and their values.
Any hints ? thanks