Created
May 21, 2014 10:51
-
-
Save GaryJones/e680bf0544cead75a213 to your computer and use it in GitHub Desktop.
Handle is_front_page() edge case settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
is_front_page() requires that if the static radio button is chosen, that | |
a page is assigned to the Front Page dropdown. Without the latter, | |
is_front_page() doesn't return true for /. | |
is_home() will return true for / in this case, but that also will be | |
true for the page assigned as the blog page which already has a title. | |
The check therefore needs to cover several factors. | |
*/ | |
if ( is_front_page() || ( is_home() && get_option( 'page_for_posts' ) && ! get_option( 'page_on_front' ) && ! get_queried_object() ) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment