B2缩略图修改
主题 Modules/Common/Post.php 467 行
public static function get_post_thumb($post_id = 0){
if(!$post_id){
global $post;
if(!isset($post->ID)) return '';
$post_id = $post->ID;
}
$post_thumbnail_url = get_the_post_thumbnail_url($post_id,'full');
if($post_thumbnail_url){
return esc_url($post_thumbnail_url);
}else{
$post_content = get_post_field('post_content', $post_id);
return b2_get_first_img($post_content);
}
return '';
}
修改之后
public static function get_post_thumb($post_id = 0){
if(!$post_id){
global $post;
if(!isset($post->ID)) return '';
$post_id = $post->ID;
}
$post_thumbnail_url = get_the_post_thumbnail_url($post_id,'full');
if($post_thumbnail_url){
return esc_url($post_thumbnail_url);
} else if (function_exists('get_wpac_thumbnail')){
return get_wpac_thumbnail($post_id);
} else {
$post_content = get_post_field('post_content', $post_id);
return b2_get_first_img($post_content);
}
return '';
}
你可能还喜欢下面这些文章

wpac是一款wordpress自动配图插件,可以丰富文章内容,对提升排名有很大帮助。 p style=”font-size:18px; “>你可能还喜欢下面这些文章< p>{excerpt}<

为了让wordpress更好用,我们开发了一款wp工具箱插件。 imwpf提供 免登录发布接口、优化工具箱(定时任务开关,修订版开关,wp-json开关,缩略图开关)、防垃圾评论、后台文章分类标签ID显示、百度推送、收录快捷查看 功能,并且还在持续增加中。

WordPress怎么自动提取内容中第一张图片作缩略图? /i’, $post-> ” width=”200px” height=”200px” />

现在写点文章不配图总觉得文章质量不太高。 于是萌生了写一款文章自动配图的插件的想法。 文章页自动加一张图比较简单,从候选集中选择一张图片拼接在正文中即可。 又比如在图片中添加文章标题,摘要或者自定义的文字。

欢迎使用WordPress自动图片插件。 进入正文图选项,开启文章配图,如下: 这个设置稍微麻烦一点,如果您是WordPress资深用户且不希望配图消耗磁盘空间,建议尝试使用该高级特性。

如何使用WordPress内置图片仓库制作缩略图? php _fcksavedurl=””< php” _fcksavedurl=””< ” alt=”<
微信赞赏
支付宝赞赏