Created
May 30, 2014 17:41
-
-
Save JanHoek/33581cb06847633ac221 to your computer and use it in GitHub Desktop.
Show manual excerpt after the header on any Page or Post in Genesis
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 // remove this line | |
//* Activate Manual excerpt on Pages | |
add_post_type_support('page', 'excerpt'); | |
//* Show Manual excerpt After Header | |
function jan_show_manual_excerpt() { | |
$post = get_post( get_the_ID() ); | |
$the_excerpt = $post->post_excerpt; | |
if ( !is_singular() || empty( $the_excerpt ) ) | |
return; | |
echo '<div class="manual-excerpt"><div class="wrap">'.$post->post_excerpt.'</div></div>'; | |
} | |
add_action ( 'genesis_after_header', 'jan_show_manual_excerpt' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment