🎉 恭喜你发现了宝藏!

子比主题增加精选

文章最后更新时间:2025-07-02 20:09:11

效果如图

2024012109530427

 

简介:

在子比主题文章封面图左上角显示一个精选标识,可自定义替换文字,提高对文章的阅览定位。后台设置勾选即可。

1、编辑文章的时候勾选是否精选文章

202401210940191

 

教程:

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://www.xzxs8.com'),
      'id'      => 'jx',
      'type'    => 'Checkbox',
      'label'   => '是否精选文章',
      'default' => false // or false
    ),
  ),
));

2、将以下代码放到zib-posts-list.php文件中,如图位置:

 

2024012109541835

此文章仅供学习 请在下载24小时内删除。
© 版权声明
THE END
喜欢就支持一下吧
点赞5赞赏 分享
评论 抢沙发

    暂无评论内容