在摘錄的末尾新增閱讀更多連結

為此,請將以下程式碼放在 functions.php 中

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

結果應如下所示:

StackOverflow 文件