Last active
October 15, 2016 17:41
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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