请求协助修改Twenty Seventeen主题的Continue Reading链接文本
Hey Dmitriy, great question—changing that "Continue Reading" link text is totally doable, and I’ll walk you through two solid methods (both avoid modifying the parent theme directly, which is critical to keep your changes safe when the theme updates):
方法1:使用子主题的functions.php(推荐)
If you already have a child theme set up (you should, for any customizations!), just add this code to its functions.php file. This covers both the excerpt-based "Continue Reading" link and the one triggered by the <!--more--> tag in your posts:
// 替换文章摘要的"Continue Reading"链接文本 function custom_twentyseventeen_excerpt_more( $more ) { $custom_text = __( '阅读全文', 'twentyseventeen' ); // 这里改成你想要的文本 return ' <a class="more-link" href="' . esc_url( get_permalink() ) . '">' . $custom_text . '</a>'; } add_filter( 'excerpt_more', 'custom_twentyseventeen_excerpt_more' ); // 替换<!--more-->标签对应的"Continue Reading"链接文本 function custom_twentyseventeen_content_more_link( $link ) { $custom_text = __( '阅读全文', 'twentyseventeen' ); // 和上面保持一致 return str_replace( 'Continue Reading', $custom_text, $link ); } add_filter( 'the_content_more_link', 'custom_twentyseventeen_content_more_link' );
Just replace '阅读全文' with whatever text you want to use (like "Read Full Post" or your preferred language equivalent). The __() function ensures the text is translation-ready if you need that later.
方法2:使用字符串替换插件(无需代码)
If you’d rather not mess with code, the Say What? plugin is perfect for this. Here’s how to use it:
- Install and activate the plugin from your WordPress dashboard.
- Go to Tools > Text Changes in your admin menu.
- Add a new text change with these details:
- Original string:
Continue Reading - Text domain:
twentyseventeen - Replacement string: [Your custom text here]
- Original string:
- Save the change, and you’re done!
Important Note
Never edit the parent Twenty Seventeen theme’s files directly—any changes you make there will be wiped out the next time the theme gets an update. Using a child theme or plugin keeps your customizations safe.
内容的提问来源于stack exchange,提问作者Dmytro Reznik

