Customize the Read More Text

Customize the Read More Text to modify the default text for excerpts.

<?php
/**
 * Customize the "Read More" text for excerpts.
 *
 * @param string $more The default "Read More" text.
 * @return string Modified "Read More" text.
 */
function custom_read_more_text($more) {
    return '... <a class="read-more" href="' . get_permalink() . '">Read More</a>';
}
add_filter('excerpt_more', 'custom_read_more_text');

Post Comment