有没有可能通过任何插件或代码修改,在frontpage和单击“阅读更多”时显示不同的内容。所以,我可以让一个帖子在首页和文章页上看起来不同,这样一旦有人点击它就会显示不同的帖子或内容。
发布于 2016-03-01 19:38:02
你试过使用the_excerpt吗?
wordpress codex - the_excerpt();
您也可以修改摘录阅读更多文本,默认为...通过添加筛选器。
/**
* Filter the excerpt "read more" string.
*
* @param string $more "Read more" excerpt string.
* @return string (Maybe) modified "read more" excerpt string.
*/
function wpdocs_excerpt_more( $more ) {
return 'Custom read more text';
}
add_filter( 'excerpt_more', 'wpdocs_excerpt_more' );摘录本身是在管理员的创建/编辑帖子中设置的。
您可能需要在管理员中显示该字段,这可以在创建/编辑帖子顶部的屏幕选项中完成。
如果您需要比the_excerpt提供的更多的自由度,我建议您使用自定义元。
https://stackoverflow.com/questions/35698010
复制相似问题