WordPress教程 WordPress自动文章添加特色图片教程
WordPress的特色图像是一个很实用的功能,可以在文章列表中为每篇文章添加一张缩略图。但特色图像需要在编辑文章时手动添加很不方便,下面的代码可自动将文章中的第一张图片设置为特色图像。将下面的代码添加到当前主题的functions.php中:function wpforce_featured() {global $post;$already_has_thumb = has_post_thumbnail($post->ID);if (!$already_has_thumb) {$attach.
转载
2020-08-10 01:52:54 ·
1155 阅读 ·
0 评论