Skip to content

Instantly share code, notes, and snippets.

@AndreFCAmorim
Created November 6, 2022 15:31
Show Gist options
  • Save AndreFCAmorim/e650da4ad97b15ca97db556b8cecf828 to your computer and use it in GitHub Desktop.
Save AndreFCAmorim/e650da4ad97b15ca97db556b8cecf828 to your computer and use it in GitHub Desktop.
Change Read More Text for Excerpts on WordPress
<?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