Last active
November 19, 2015 17:32
-
-
Save ThierryA/9bd05dd7beb459828591 to your computer and use it in GitHub Desktop.
Beans: display excerpt on home/front page.
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 | |
// 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