Skip to content

Instantly share code, notes, and snippets.

@CapWebSolutions
Created February 7, 2018 23:11
Show Gist options
  • Select an option

  • Save CapWebSolutions/806508182778f4657024898bd3935309 to your computer and use it in GitHub Desktop.

Select an option

Save CapWebSolutions/806508182778f4657024898bd3935309 to your computer and use it in GitHub Desktop.
Add Read More button to blog page and archives
// Add Read More button to blog page and archives
add_filter( 'excerpt_more', 'prefix_add_excerpt_more' );
add_filter( 'get_the_content_more_link', 'prefix_add_excerpt_more' );
add_filter( 'the_content_more_link', 'prefix_add_excerpt_more' );
function prefix_add_excerpt_more( $more ) {
return '<span class="more-link"><a href="' . get_permalink() . '" rel="dofollow">' . __( 'Read More', 'prefix' ) . '</a></span>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment