Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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