Skip to content

Instantly share code, notes, and snippets.

@ChrisCree
Created May 21, 2014 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisCree/a072fb64afeb7c9de9e7 to your computer and use it in GitHub Desktop.
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.
<?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