How to get the original post_id of a static home page?

I can’t figure out how to get the original post_id of a specific page if that page has been set as the static posts page of the blog.

I have a page that normally has a post_id of 95, but as soon as I set it to the static posts page, it returns a post_id of 0 and it’s causing me lots of headaches.

Read More

How can I retrieve the original post_id – which is stored in the DB because it comes right back if I make it not the static posts page any longer.

Related posts

Leave a Reply

1 comment

  1. the id of the posts page is:

    $posts_page_id = get_option( 'page_for_posts' );
    

    the conditional tag for the posts page would be: is_home()

    edit:
    the id of the static front page is:

    $front_page_id = get_option( 'page_on_front' );