I’m not sure if lang
is a reserved/used query variable in WordPress, but if it’s not, then adding might help. Use a filter on query_vars
like this:
function my_query_vars( $vars ) {
$vars[] = 'lang';
return $vars;
}
add_filter( 'query_vars', 'my_query_vars' );
Although WordPress will now know about the language query variable, I’m not sure what’s causing your is_front_page()
to stop returning true, perhaps it’s not about your query variables but about the query itself, because is_front_page()
depends on the $wp_query
global object.
So how does your language plugin work? If you’ve set a page with an id of 10
as your front page, then is_front_page()
for that page will return true
, but if your language plugin is filtering the query and grabbing a page with an id of 50
(which is page 10 translated into Italian) then it’s no longer the front page.
Give us a little bit more info about which plugin you’re using to handle translations and if you wrote it yourself let us know how it works 🙂
Cheers!