Skip to content

Instantly share code, notes, and snippets.

@peterwilsoncc
Created October 17, 2011 03:51
Show Gist options
  • Save peterwilsoncc/1291904 to your computer and use it in GitHub Desktop.
Save peterwilsoncc/1291904 to your computer and use it in GitHub Desktop.
WordPress - output page title on is_home() when displaying news on a sub page
<?php
if ( (is_home()) && (get_option('show_on_front') == 'page') && (get_option('page_for_posts') != 0) ) {
echo '<h1>' . esc_html(get_the_title(get_option('page_for_posts'))) . '</h1>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment