How to get post id of static front page?

WordPress has a few useful options. You can get the homepage ID by using the following:

$frontpage_id = get_option( 'page_on_front' );

or the blog ID by using:

$blog_id = get_option( 'page_for_posts' );

Here’s a list of many useful get_option parameters.

Leave a Comment

tech