#StackBounty: #functions #read-more Why does modifying the "read more" link remove the link class?

Bounty: 50

I’m using the following code (found on the WordPress.org site) to modify my (more…) text:

//Modify "read more" text
function modify_read_more_link() {
    return '<a class="more-link" href="' . get_permalink() . '">(Continue…)</a>';
}
add_filter( 'the_content_more_link', 'modify_read_more_link' );

The code works as expected, in the sense that (more…) is properly replaced by (Continue…), and the link works as intended. However, there is a peculiar issue: The class more-link has disappeared, which means styling doesn’t work. I attempted to circumnavigate the issue by adding styling inline (return '<a style="font-size:0.8em;" href="' . get_permalink() . '">(Continue…)</a>';) but that hasn’t worked either.

My Question:
Why has the class more-link disappeared, and how can I restore it?

Note: I add the code above to functions.php; I’m not using a child theme.


Get this bounty!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.