首页›网站源码›正文

『子比功能自定义二』分类/标签页面 文章数总计、描述隐藏

暂无可下载资源资源正在补充中,敬请期待
💡 温馨提示:建议使用电脑端下载,大文件下载可能需要较长时间,请耐心等待,下载完成后请校验文件完整性。

服务保障

纯净无捆绑

精简优化,纯净系统

安全可靠

多重检测,放心使用

持续更新

长期维护,持续优化

专业制作

系统玩家,品质保证

免费使用

完全免费,长期更新

已通过安全检测无病毒 / 无木马 / 无广告100%纯净资源支持在线校验文件完整性
⚙ 文件校验 MD5 / SHA1 / SHA256
🤖 AI 智能摘要
此内容由 AI 根据文章内容自动生成,并已由人工审核
正在打开 AI 智能摘要...

下载完成了吗?

请问该资源下载顺利吗?使用起来感觉如何?
✓
感谢你的反馈!
我们会持续优化资源质量,为你提供更好的下载体验。

服务协议

文章介绍
发表评论
更新日志
历史版本

前言

修改教程仅用于功能实现,如果您觉得功能不需要,可以路过,谢谢。

实现效果:

 

 

 

上下对比

定位文件

本文隐藏内容
  • zibll/inc/options/admin-options.php
  • zibll/inc/functions/zib-category.php

代码

本文隐藏内容
  • admin-options.php 搜索 “分类页面” ,下面插入红框代码

 

代码:

 
 
 
array(
'title' => __('显示文章总计', 'zib_language'),
'id' => 'page_cat_sum_s',
'type' => 'switcher',
'default' => true,
),
array(
'title' => __('显示分类描述', 'zib_language'),
'id' => 'cat_show_desc',
'type' => 'switcher',
'default' => true,
),
  • admin-options.php 搜索 “标签页面” ,下面插入红框代码

 

代码:

 
 
 
array(
'title' => __('显示文章总计', 'zib_language'),
'id' => 'page_tag_sum_s',
'type' => 'switcher',
'default' => true,
),
array(
'title' => __('显示分类描述', 'zib_language'),
'id' => 'tag_show_desc',
'type' => 'switcher',
'default' => true,
),
  • zib-category.php 
  • 搜索 “zib_cat_cover()”函数,整个函数替换:
 
 
 
function zib_cat_cover($cat_id = '')
{
if (!$cat_id) {
$cat_id = get_queried_object_id();
}
if (_pz('cat_show_desc', true)){
$desc = trim(strip_tags(category_description()));
if (is_super_admin() && !$desc) {
$desc = '请在Wordress后台-文章-文章分类中添加分类描述!';
}
 
$desc .= zib_get_term_admin_edit('编辑此分类');
}
//global $wp_query;
 
$cat = get_category($cat_id);
$count = zib_get_cat_postcount($cat_id, 'category');
$title = '<i class="fa fa-folder-open em12 mr10 ml6" aria-hidden="true"></i>' . $cat->cat_name;
if (_pz('page_cat_sum_s', true)){
$title .= '<span class="icon-spot">共' . $count . '篇</span>';
} else {
$title .= '';
}
//$title .='<pre>'. json_encode($wp_query) .'</pre>';
if (_pz('page_cover_cat_s', true)) {
$img = zib_get_taxonomy_img_url(null, null, _pz('cat_default_cover'));
zib_page_cover($title, $img, $desc);
} else {
echo '<div class="zib-widget">';
echo '<h4 class="title-h-center">' . $title . '</h4>';
echo '<div class="muted-2-color">' . $desc . '</div>';
echo '</div>';
}
}
  • 同理搜索 “zib_tag_cover()”函数,整个函数替换:
 
 
 
function zib_tag_cover()
{
if (_pz('tag_show_desc', true)){
$desc = trim(strip_tags(tag_description()));
if (is_super_admin() && !$desc) {
$desc = '请在Wordress后台-文章-文章分类中添加标签描述!';
}
 
$desc .= zib_get_term_admin_edit('编辑此标签');
}
global $wp_query;
$tag_id = get_queried_object_id();
$tag = get_tag($tag_id);
$count = $tag->count;
$title = '<i class="fa fa-tag em12 mr10 ml6" aria-hidden="true"></i>' . $tag->name;
if (_pz('page_tag_sum_s', true)){
$title .= '<span class="icon-spot">共' . $count . '篇</span>';
} else {
$title .= '';
}
if (_pz('page_cover_tag_s', true)) {
$img = zib_get_taxonomy_img_url(null, null, _pz('tag_default_cover'));
zib_page_cover($title, $img, $desc);
} else {
echo '<div class="zib-widget">';
echo '<h4 class="title-h-center">' . $title . '</h4>';
echo '<div class="muted-2-color">' . $desc . '</div>';
echo '</div>';
}
}

最后

  • 修改文件具有风险,注意备份相关文件
THE END
© 版权声明
点赞4572 分享
暂无内容
暂无更新日志
暂无内容
暂无历史版本

『子比功能自定义二』分类/标签页面 文章数总计、描述隐藏

前言

修改教程仅用于功能实现,如果您觉得功能不需要,可以路过,谢谢。

实现效果:

 

 

 

上下对比

定位文件

本文隐藏内容
  • zibll/inc/options/admin-options.php
  • zibll/inc/functions/zib-category.php

代码

本文隐藏内容
  • admin-options.php 搜索 “分类页面” ,下面插入红框代码

 

代码:

 
 
 
array(
'title' => __('显示文章总计', 'zib_language'),
'id' => 'page_cat_sum_s',
'type' => 'switcher',
'default' => true,
),
array(
'title' => __('显示分类描述', 'zib_language'),
'id' => 'cat_show_desc',
'type' => 'switcher',
'default' => true,
),
  • admin-options.php 搜索 “标签页面” ,下面插入红框代码

 

代码:

 
 
 
array(
'title' => __('显示文章总计', 'zib_language'),
'id' => 'page_tag_sum_s',
'type' => 'switcher',
'default' => true,
),
array(
'title' => __('显示分类描述', 'zib_language'),
'id' => 'tag_show_desc',
'type' => 'switcher',
'default' => true,
),
  • zib-category.php 
  • 搜索 “zib_cat_cover()”函数,整个函数替换:
 
 
 
function zib_cat_cover($cat_id = '')
{
if (!$cat_id) {
$cat_id = get_queried_object_id();
}
if (_pz('cat_show_desc', true)){
$desc = trim(strip_tags(category_description()));
if (is_super_admin() && !$desc) {
$desc = '请在Wordress后台-文章-文章分类中添加分类描述!';
}
 
$desc .= zib_get_term_admin_edit('编辑此分类');
}
//global $wp_query;
 
$cat = get_category($cat_id);
$count = zib_get_cat_postcount($cat_id, 'category');
$title = '<i class="fa fa-folder-open em12 mr10 ml6" aria-hidden="true"></i>' . $cat->cat_name;
if (_pz('page_cat_sum_s', true)){
$title .= '<span class="icon-spot">共' . $count . '篇</span>';
} else {
$title .= '';
}
//$title .='<pre>'. json_encode($wp_query) .'</pre>';
if (_pz('page_cover_cat_s', true)) {
$img = zib_get_taxonomy_img_url(null, null, _pz('cat_default_cover'));
zib_page_cover($title, $img, $desc);
} else {
echo '<div class="zib-widget">';
echo '<h4 class="title-h-center">' . $title . '</h4>';
echo '<div class="muted-2-color">' . $desc . '</div>';
echo '</div>';
}
}
  • 同理搜索 “zib_tag_cover()”函数,整个函数替换:
 
 
 
function zib_tag_cover()
{
if (_pz('tag_show_desc', true)){
$desc = trim(strip_tags(tag_description()));
if (is_super_admin() && !$desc) {
$desc = '请在Wordress后台-文章-文章分类中添加标签描述!';
}
 
$desc .= zib_get_term_admin_edit('编辑此标签');
}
global $wp_query;
$tag_id = get_queried_object_id();
$tag = get_tag($tag_id);
$count = $tag->count;
$title = '<i class="fa fa-tag em12 mr10 ml6" aria-hidden="true"></i>' . $tag->name;
if (_pz('page_tag_sum_s', true)){
$title .= '<span class="icon-spot">共' . $count . '篇</span>';
} else {
$title .= '';
}
if (_pz('page_cover_tag_s', true)) {
$img = zib_get_taxonomy_img_url(null, null, _pz('tag_default_cover'));
zib_page_cover($title, $img, $desc);
} else {
echo '<div class="zib-widget">';
echo '<h4 class="title-h-center">' . $title . '</h4>';
echo '<div class="muted-2-color">' . $desc . '</div>';
echo '</div>';
}
}

最后

  • 修改文件具有风险,注意备份相关文件
© 版权声明
THE END
点赞4572 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容