Skip to content

Instantly share code, notes, and snippets.

@ChrisCree
Last active March 15, 2018 22:55
Show Gist options
  • Save ChrisCree/5888660 to your computer and use it in GitHub Desktop.
Save ChrisCree/5888660 to your computer and use it in GitHub Desktop.
Genesis doesn't put a page title on the blog page template by default. Here's a a function that will do that for you. Just drop it into your functions.php file.
<?php
// Don't copy the opening <?php tag above
// Add page title to blog page template
add_action( 'genesis_before', 'wsm_blog_page_title' );
function wsm_blog_page_title() {
if ( is_page_template( 'page_blog.php' ) ) {
add_action( 'genesis_before_content', 'wsm_show_blog_page_title_text', 2 );
}
}
function wsm_show_blog_page_title_text() {
echo '<h1 class="entry-title">' . get_the_title() . '</h1>';
}
@dietcheese
Copy link

This doesn't seem to work for me. get_page_template() always returns /wp-content/themes/genesis/page.php, when using a child theme.

@eduardoaldaz
Copy link

this doesn't seem to work for me too.. :(

@DesignMeCG
Copy link

DesignMeCG commented Mar 15, 2018

You can find the info here: https://wpsites.net/web-design/how-to-add-a-entry-title-to-your-blog-page-or-posts-page/

(sorry - due to the copyright of the site, I can't post the snippet here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment