67

In WordPress settings you can set a page as the Posts Page. This can be found:

WP-Admin->Settings->Reading Settings->Front page displays

Front page displays settings

How do I retrieve the page ID that is set in this setting?

1 Answer 1

117

Use the page_for_posts option:

<?php
$page_for_posts = get_option( 'page_for_posts' );
?>

This will return the ID of the Page assigned to display the Blog Posts Index.

1
  • Still working to this day
    – Gendrith
    Apr 28 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.