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

如何使用WordPress内置图片仓库制作缩略图? php _fcksavedurl=””< php” _fcksavedurl=””< ” alt=”<

字段类型含义必须例子post_titlestring文章标题是这是一个标题post_contentstring文章内容是这是文章内容post_categorystring文章分类不存在时会自动创建多个用逗号隔开是分类1,分类2post_tagsstring文章标签不存在会自动创建多个用逗号隔开否标签1,标签2post_namestring文章别名否biaoti 接口就支持seo_title这个字段,发布时会将内容发布到seo_title自定义字段。

当一个元素有多个class属性时会发生什么? div id=”test” class=”one two three” class=”four”> div id=”post-<
微信赞赏
支付宝赞赏