Determine if the Front Page Displays the Latest Posts or a Static Page on a WordPress Powered Site
For some applications, it is necessary to know what WordPress is displaying on the front page of the site. This need, for the AmberPanther team arose in the development of our proprietary Breadcrumb navigation plugin.
To correctly build the breadcrumb navigation, in the event the front page is displaying a static page and the latest posts where displayed on some other page, it is necessary to check what is displayed on the front page. WordPress saves this information in the database and can be easily retrieved with the get_option() function.
To check what is shown on the front page use:
$show_on_front = get_option('show_on_front');
The $show_on_front variable will equal either page or posts. In the event that the front page displays a page, and you need to know on what page the latest posts are displayed use:
$page_for_posts = get_option('page_for_posts');
The $page_for_posts variable will contain the name of the page that shows the latest posts.
In our case this allows for the creation of an informative breadcrumb navigation… What is your application?

, or by using our


