Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active December 29, 2015 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cliffordp/18d6ffa6bb2ac221827c to your computer and use it in GitHub Desktop.
Save cliffordp/18d6ffa6bb2ac221827c to your computer and use it in GitHub Desktop.
<?php
// Add "Blog" page title even when wp-admin > Settings > Reading > Posts page is set to a specific page
// Tested with Modern Studio Pro Theme v1.0 on Genesis v2.2.5
// From: https://gist.github.com/cliffordp/18d6ffa6bb2ac221827c
add_action( 'genesis_before_loop', 'tk_add_blog_title' );
function tk_add_blog_title() {
$page_id_for_posts = get_option( 'page_for_posts' );
if( is_home() && ! empty( $page_id_for_posts ) ) {
printf( '<header class="entry-header"><h1 class="entry-title" itemprop="headline">%s</h1></header>', get_the_title( $page_id_for_posts ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment