[WordPress]Oops, customized query vars make front page missing
There is a very strange thing which may be a bug but not fixed yet in WordPress -- If you add a customized query var, it will make the WordPress lost the static front page and directly point to the post river. (As discussed in https://core.trac.wordpress.org/ticket/25143#comment:36 ) For example, if our static front page is http://www.example.com/ and we add following code to add a query var named 'lang' hoping that we could get 'lang' from the structure of http://www.example.com/%lang% function add_custom_page_variables ( $ public_query_vars ) { $ public_query_vars [] = ' lang '; return $ public_query_vars ; } add_filter ( ' query_vars ', array ( $ this , ' add_custom_page_variables ' ) ) ; It doesn't work. get_query_var will return null and what is worse, the front page will lost if we use http://www.example.com/en. Actually, current parse_query will check $_query after it thinks it is a home pa