Last active
December 29, 2015 23:14
-
-
Save cliffordp/18d6ffa6bb2ac221827c to your computer and use it in GitHub Desktop.
This file contains 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 | |
// 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