Created
November 6, 2022 15:31
-
-
Save AndreFCAmorim/e650da4ad97b15ca97db556b8cecf828 to your computer and use it in GitHub Desktop.
Change Read More Text for Excerpts on WordPress
This file contains 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 | |
function wpcode_snippets_change_read_more( $read_more, $read_more_text ) { | |
// Edit the line below to add your own "Read More" text. | |
$custom_text = 'Read the whole post'; | |
$read_more = str_replace( $read_more_text, $custom_text, $read_more ); | |
return $read_more; | |
} | |
add_filter( 'the_content_more_link', 'wpcode_snippets_change_read_more', 15, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment