您可以获得两个内容之间的差异,然后在第一个内容中添加一定数量的单词,如以下所示(不确定,但请尝试一下;):
global $more;
$more = 0;
$content_cut = get_the_content( \'\' );
$more = 1;
$content_full = get_the_content();
// Get the diff
$content_diff = str_replace( $content_cut, \'\', $content_full );
// Get 10 first words
$some_more_content = wp_trim_words( $content_diff, 10, \'link_more_here\' );
// Add it to the end of cut content
$content_cut .= $some_more_content;
echo $content_cut;
The
linl_more_here 参数是optionnal,通常是带有当前帖子永久链接的标记。