1、修改:
ripro-v2\ripro-v2\inc\options\taxonomy-options.php
将注释去掉。如下:
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
暂无评论内容