how to check if front page is set to show a static page

I need to determine whether the reading settings are set to use a static page or the latest post for the front page.

Is there a conditional that will return true if the front page is set to show a static page? I don’t need to check what page the static page might be, just if its a static page at all.

Read More

For this scenario would it be correct to use:

if( is_front_page() && !is_home() ){
   // seems we're on the front but not on the blog home,
   // so it must be a static page..
}

Related posts

Leave a Reply

1 comment

  1. Your conditional logic makes sense as well but you’re probably looking for this:

    if ( 'page' == get_option('show_on_front') ) {
       // do something
    }
    

    Hint: You can append options.php to the WordpPress admin url like this:
    http://www.example.com/wp-admin/options.php to see all options.
    ( that’s where I found the answer for you .)