I beg to differ with you. is_home (or the alternative is_front_page) are query vars.
When building the front page from the set page in the customizer the theme knows that this is not a “normal” page but the Home page.
So additional to the is_page being true which is normal for any page displayed I expect the theme to set is_home. This is quite easy to do with set_query_var(‘is_home’, true);
A similar thing applies to the posts page. Whether or not the allocated page is “promoted” to posts page should also be reflected in the query var is_posts_page.
So you are free to change the query vars if there is a special situation the case.
That is where the query vars are for.
Does this make the issue more clear?
I have to edit this: using set_query_var sets a query var and is_home is not a query var but part of query itself. So coding $wp_query->is_home = true; is the way to go.
-
This reply was modified 4 years, 10 months ago by
Harm10.