Skip to content

Instantly share code, notes, and snippets.

@ThierryA
Last active November 19, 2015 17:32
Show Gist options
  • Save ThierryA/9bd05dd7beb459828591 to your computer and use it in GitHub Desktop.
Save ThierryA/9bd05dd7beb459828591 to your computer and use it in GitHub Desktop.
Beans: display excerpt on home/front page.
<?php
// Do not include the opening php tag if it is already included in your file.
add_filter( 'the_content', 'beans_child_modify_post_content' );
function beans_child_modify_post_content( $content ) {
// Return the excerpt() if it exists and if it is the home/fron page.
if ( has_excerpt() && ( is_home() || is_front_page() ) )
return '<p>' . get_the_excerpt() . '</p><p>' . beans_post_more_link() . '</p>';
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment