wordpress 获取某一文章第一个缩略图,特色图片

define('WP_USE_THEMES', false); //无需使用主题
include_once('./wp-load.php');  //根据wordpress路径来调用 需要同服务器下
function get_posts_thumb($postsid){//获取某一文章第一个缩略图,特色图片
$thumb_id = get_post_thumbnail_id($postsid);
$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
return $thumb_url[0];
}
© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容