Last active
August 10, 2020 09:51
-
-
Save studiopress/5700336 to your computer and use it in GitHub Desktop.
Genesis post excerpts.
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 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>'; | |
} |
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 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 | |
} |
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 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