Last active
July 23, 2017 17:33
-
-
Save topleague/29e3e631de906927801442efaff65732 to your computer and use it in GitHub Desktop.
Genesis Add Excerpts to Pages
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
//* Display Page Title and Page Excerpt (as Subtitle) after Header | |
add_action( 'genesis_header', 'topleague_remove_page_title'); | |
function topleague_remove_page_title () { | |
if ( is_singular( 'page' ) && !is_front_page() ) { // apply to all pages except the front page | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
add_action( 'genesis_after_header', 'topleague_after_header_content' ); | |
function topleague_after_header_content() { | |
echo '<div class="page-description">'; | |
echo '<h1 itemprop="headline" class="page-title">' . get_the_title() . '</h1>'; // display page title | |
echo '<p>' . get_the_excerpt() . '</p></div>'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment