Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Created May 21, 2014 10:51
Show Gist options
  • Save GaryJones/e680bf0544cead75a213 to your computer and use it in GitHub Desktop.
Save GaryJones/e680bf0544cead75a213 to your computer and use it in GitHub Desktop.
Handle is_front_page() edge case settings
<?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