Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the polylang domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/vajnabot/public_html/wp-includes/functions.php on line 6121
Vajna Botond | Online portofolio | How to add read more link to your WordPress excerpt?

Vajna Botond

Designer

How to add read more link to your WordPress excerpt?

By default WordPress function the_excerpt(); does not display a read more link.
To display link to post after the excerpt you must filter the excerpt_more.

function vkb_excerpt_more($more) {
global $post;
   return '… <a href="'. get_permalink($post->ID) . '">' . 'Read More &raquo' . '</a>';
}
add_filter('excerpt_more', 'vkb_excerpt_more');

You can replace the Read More &raquo text with anything you like.