60 | Show Page Title and Content of the ‘Posts Page’ in WordPress


When you set a static front page and at the same time set a Posts Page, WordPress will automatically use index.php (or home.php *) to display the Posts Page; as described in the Codex, you’ll lose the output of the title and content of that page.
To show this information on the Posts Page, for instance as an introduction for the posts, add some code to index.php (or home.php):

<?php //this is to output the page title and content for a 'page for posts' page as set under  'settings' - 'reading'
	if( is_home() && !is_paged() && get_option('page_for_posts') ) { 
	$posts_page_id = get_option('page_for_posts'); ?>			
	<header class="entry-header">
		<h1 class="entry-title"><?php echo get_the_title($posts_page_id); ?></h1>
	</header><!-- .entry-header -->
	<?php $posts_page = get_page( $posts_page_id ); ?>
	<div class="entry-content posts-page-entry-content">
	<?php echo apply_filters('the_content', $posts_page->post_content); ?>
	</div><!-- .posts-page-entry-content -->	
<?php } ?>
This entry was posted in Tips & Tricks, WordPress and tagged , , , . Bookmark the permalink.

8 Responses to Show Page Title and Content of the ‘Posts Page’ in WordPress

  1. Kasack Große Größen comments:

    Super geschrieben.Vielen Dank.

  2. kasack lang comments:

    Interessanter Artikel.

  3. Berufsbekleidung Für Pflegeberufe comments:

    Interessanter Artikel.

  4. Bharat comments:

    Dear Michael,
    I am really new to wordpress development. I want to add title to every page & post manually. Can you please give me code as you have given for meta description i n your post.

  5. Ian comments:

    After much scratching of the head, and trawling through various forums – i finally found this, which was the solution to my problem!

    Massive thanks 😀

  6. Matthew comments:

    Hi Alchymyth,

    I copied the index.php to my child theme and add your code to it, it works like a charm!

    However, I am wondering if there is anyway that we can further improve this method. For example, I want to make this index.php as one of my page templates. I found when I change the name of index.php, it doesn’t work. Would you mind adding the solution to your post, I think that will benefit lots of WordPress users.

    Thanks and regards,


    • Michael replies:

      Hi Matthew,
      for a page template, the page title and content are directly available with a ‘default’ loop, which you could have before the custom template code. see the Codex; or check the WordPress support forum for possible solutions.

  7. Pingback: Show Page Title and Content of the 'Posts Page' in WordPress … | Scion Players


    05/09/2012 | […] Show Page Title and Content of the 'Posts Page' in WordPress … This entry was posted in…

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.