【WordPress】 继续阅读按钮

嗷没想到,做WordPress的第一个事情居然是搞定“继续阅读”这个小东西。

① 在wp-content\themes目录下,选择你自己安装模板,然后打开index.php,Ctrl+F搜索【get_template_part】,找到下面示例中括号里面的XXX

示例:get_template_part( ‘xxx’, get_post_format() );

②打开XXX.php,然后Ctrl+F搜索【Continue reading】,找到下图位置:

③ 将这个位置作出修改,改成如下代码:

if(!is_single()){
		    the_excerpt();
		}
		else{
		    the_content(
				sprintf(
					/* translators: %s: Post title. */
					__( 'Continue reading %s', 'twentyfifteen' ),
					the_title( '<span class="screen-reader-text">', '</span>', false )
				)
			);
		}

④ 保存,然后刷新WordPress主页。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注