Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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