Created
May 21, 2014 18:31
-
-
Save ChrisCree/a072fb64afeb7c9de9e7 to your computer and use it in GitHub Desktop.
The normal "read more" code for Genesis does not add the read more link to short manual excerpts. The blow code will do so.
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
<?php | |
// Do not copy opening PHP tag | |
// Add Read More button to blog page and archives | |
add_filter( 'get_the_content_more_link', 'wsm_add_excerpt_more' ); | |
add_filter( 'the_content_more_link', 'wsm_add_excerpt_more' ); | |
function wsm_add_excerpt_more( $more ) { | |
return '<span class="more-link"><a href="' . get_permalink() . '" rel="nofollow">' . __( 'Read More', 'wsm' ) . '</a></span>'; | |
} | |
add_filter( 'the_excerpt', 'wsm_add_short_excerpt_more' ); | |
function wsm_add_short_excerpt_more( $output ) { | |
global $post; | |
return $output . ' <span class="more-link"><a href="' . get_permalink() . '" rel="nofollow">' . __( 'Read More', 'wsm' ) . '</a></span>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment