use query variable on landing page without redirect

I have the following in functions.php:

add_filter( ‘query_vars’, ‘add_query_vars’ );

function add_query_vars( $qvars ){
$qvars[] = “style_date”;
return $qvars;
}

Things work as they should on specific pages such as www.mysite.com/article-1?style_date=2018-04-08 (I’m temporarily using this to load arbitrary style sheets on the fly on my staging site).

However, using this query var on the landing page (e.g., www.mysite.com/?style_date=2018-04-08) redirects me to my Posts page. .htaccess has not been modified outside of WP.

How can I use a query variable on my landing page without any redirects?

Read more here:: use query variable on landing page without redirect

Leave a Reply

Your email address will not be published. Required fields are marked *