wordpress riprov2自定义分类下文章缩略图宽高设置教程

1、修改:
ripro-v2\ripro-v2\inc\options\taxonomy-options.php
将注释去掉。如下:

图片[1]-wordpress riprov2自定义分类下文章缩略图宽高设置教程-HostJL-VPS主机交流
2、后台分类中将自定义栏目缩略图开关打开
3、打开/wp-content/themes/ripro-v2/inc/template-tags.php
搜索:
根据模式输出缩略图img 延迟加载html标签
将下边代码:

if (!function_exists('_get_post_media')) {
    function _get_post_media($post = null, $size = 'thumbnail',$video = true) {
        if (empty($post)) {
            global $post;
        }elseif (is_numeric($post)) {
            $post = get_post($post);
        }

        $_size_px = _get_post_thumbnail_size();

        $src = _get_post_thumbnail_url($post, $size);

替换成:

if (!function_exists('_get_post_media')) {
    function _get_post_media($post = null, $size = 'thumbnail',$video = true) {
        if (empty($post)) {
            global $post;
        }
        $category = get_the_category($post->ID);
        $catid = $category[0]->term_id;
        if (get_term_meta($catid, 'is_thumb_px', true)) {
            $_size_px = get_term_meta($catid, 'thumb_px', true); //缩略图高度
        }else{
            $_size_px = _get_post_thumbnail_size();
        }

        $src = _get_post_thumbnail_url($post, $size);
© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容