Add this code to functions.php file and edit change “Your Read More Link Text” to anything you want. This will also work via Child Theme functions.php if you use one.
add_filter( 'the_content_more_link', 'modify_read_more_link' );
function modify_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
}
Hi, I added the code below, but didn’t change the text. I tried three times now, but every time I added the code, I got Warning and had to remove Child Theme function.phpfile (and re-create new one).
add_filter( 'the_content_more_link', 'modify_read_more_link' );
function modify_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
}
I feel like it should be simple to change (more…) text, but haven’t been able to get it done.
Please help…
This code will replace Read More text to “Your Read More Link Text”. Make sure to edit it accordingly.
Add this code to Child Theme functions.php right before closing ?>
// Get rid of the current one by removing filter
function child_theme_setup() {
// override parent theme's 'more' text for excerpts
remove_filter( 'excerpt_more', 'travelify_continue_reading' );
}
add_action( 'after_setup_theme', 'child_theme_setup' );
// Add new filter to change Read More button text.
add_filter( 'the_content_more_link', 'modify_read_more_link' );
function modify_read_more_link() {
return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>';
}