![图片[1]- 子比主题在文章卡片上增加“精选”便签](https://www.dh139.cn/wp-content/uploads/2025/09/143254fut8til8zgtnuik5-26.jpg)
1、编辑发布文章的时候移动最下面勾选是否精选文章,也可以移动上第一选项
![图片[2]- 子比主题在文章卡片上增加“精选”便签](https://www.dh139.cn/wp-content/uploads/2025/09/143254fut8til8zgtnuik5-27-1024x415.jpg)
1、将以下代码直接放到zibll\inc\options\metabox-options.php下方:
//META BOX SETTING
CSF::createMetabox('mrhe_jingxuan', array(
'title' => '精选',
'post_type' => array('post', 'page', 'plate', 'forum_post'),
'context' => 'advanced',
'data_type' => 'unserialize',
));
CSF::createSection('mrhe_jingxuan', array(
'fields' => array(
array(
'title' => __('是否精选文章', 'https://hexsen.com'),
'id' => 'jx',
'type' => 'Checkbox',
'label' => '是否精选文章',
'default' => false // or false
),
),
));
2、将以下代码直接放到zibll/inc/functions/zib-posts-list.php中,找不到位置搜索置顶
if (get_post_meta($post->ID, 'jx', true)){
$sticky .= '<badge class="img-badge right jb-red"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-hot"></use></svg> 精选</badge>';
}
![图片[3]- 子比主题在文章卡片上增加“精选”便签](https://www.dh139.cn/wp-content/uploads/2025/09/143254fut8til8zgtnuik5-28-1024x161.jpg)
感谢您的来访,获取更多精彩文章请收藏本站。














暂无评论内容