Skip to content

Instantly share code, notes, and snippets.

@FriendlyWP
Last active October 15, 2016 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FriendlyWP/bed692b990a4c33ff6ac89241ce3e691 to your computer and use it in GitHub Desktop.
Save FriendlyWP/bed692b990a4c33ff6ac89241ce3e691 to your computer and use it in GitHub Desktop.
See if "posts page" is set in Settings > Reading; If it is, display that page's title before the posts.
<?php
// See if "posts page" is set in Settings > Reading, aka is_home()
// If it is, display this page's title before the posts
$page_for_posts = get_option( 'page_for_posts' );
if ($page_for_posts) { ?>
<header class="page-header">
<h1 class="page-title" itemprop="headline">
<?php echo get_queried_object()->post_title; ?>
</h1>
</header> <?php // end article header ?>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment