Skip to content

Instantly share code, notes, and snippets.

@studiopress
Last active August 10, 2020 09:51
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save studiopress/5700336 to your computer and use it in GitHub Desktop.
Genesis post excerpts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the Genesis content limit read more link
add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
function sp_read_more_link() {
return '... <a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the length of post excerpts
add_filter( 'excerpt_length', 'sp_excerpt_length' );
function sp_excerpt_length( $length ) {
return 50; // pull first 50 words
}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the WordPress read more link
add_filter( 'the_content_more_link', 'sp_read_more_link' );
function sp_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment