当前位置:首页>WordPress专区>WordPress美化>zibll主题美化>子比主题美化 –文章角标多彩美化

子比主题美化 –文章角标多彩美化

网上看到的很不错的美化,对文章角标做的多处的美化,醒目,功能性更强,喜欢的请自行测试。

使用教程

CSS代码放在后台自定义

/*角标css*/
.posts-item.card .item-thumbnail {
  background:#c4cffa26;
  width:100%;
  padding-bottom:var(--posts-card-scale);
}
a.item-category {
  position:absolute;
  left:10px;
  top:10px;
  padding:5px 6px;
  font-size:1rem;
  line-height:1;
  color:#fff;
  background:var(--theme-color);
  border-radius:6px;
}
a.item-category-app {
  position:absolute;
  height:24px;
  line-height:24px;
  width:100%;
  text-align:center;
  bottom:0;
  left:0;
  background:radial-gradient(circle,#3783ff,#3783ffbf);
  color:#fff;
  font-size:12px;
  border-radius:0 0 10px 10px;
}
a.item-category-app-b {
  position:absolute;
  height:24px;
  line-height:24px;
  width:100%;
  text-align:center;
  bottom:0;
  left:0;
  background:radial-gradient(circle,#ff5631,#ff5631ba);
  color:#fff;
  font-size:12px;
  border-radius:0 0 10px 10px;
}
a.item-category-app-c {
  position:absolute;
  height:24px;
  line-height:24px;
  width:100%;
  text-align:center;
  bottom:0;
  left:0;
  background:radial-gradient(circle,#464242,#464242ad);
  color:#fff;
  font-size:12px;
  border-radius:0 0 10px 10px;
}
span.bottom-l {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.n-collect-item-bottom {
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
  height:25px;
  background:var(--theme-color);
  border-radius:0 0 var(--main-radius);
  font-size:13px;
  color:#fff;
  text-shadow:0 2px 2px rgba(0,0,0,.16);
  display:flex;
  -webkit-box-align:center;
  align-items:center;
  -webkit-box-pack:justify;
  justify-content:space-between;
  padding:0 18px;
  z-index:5;
  justify-content:center;
}
.jiaobiao2 {
  position:absolute;
  top:10px;
  right:-50px;
  z-index:1;
  width:140px;
  height:20px;
  background:var(--theme-color);
  color:#fff;
  line-height:20px;
  transform:rotate(45deg);
  text-align:center;
  font-size:12px;
  left:auto;
  border-radius:0 50px 50px 0;
}

将下面代码添加进子比主题下的func.php文件内,若没有则创建一个,如果是新建func.php文件夹记得复制<?php 去掉前面两竖线

打开子比主题文件夹下的inc/functions/zib-post-list.php文件,搜索 置顶 添加以下代码

//添加在这个代码的下面一行
 if (is_sticky()) {
        $sticky = '<badge class="img-badge left jb-red">置顶</badge>';
    } else {
        $sticky = '';
    }

在下面添加

//列表图片封面右上角标
        if (get_post_meta($post->ID, 'Mario_edit', true)){
        $right = get_post_meta($post->ID, 'right_text', true);
        $right_color = get_post_meta($post->ID, 'right_color', true);
        $bottom = get_post_meta($post->ID, 'bottom_text', true);
        $bottom_color = get_post_meta($post->ID, 'bottom_color', true);
        $left_text = get_post_meta($post->ID, 'left_text', true);
        $left_color = get_post_meta($post->ID, 'left_color', true);

        if ($left_text) {
            $sticky = '<badge class="jiaobiao2" style="background:'.$left_color.';">'.$left_text.'</badge>';
        } else {
            $sticky = '';
        }
        if ($right){
            $sticky .= '<a class="item-category" style="background:'.$right_color.';"> '.$right.' </a>';
        }
        if ($bottom){
            $sticky .= '<div class="n-collect-item-bottom" style="background:'.$bottom_color.';"><span class="bottom-l">'.$bottom.'</span></div>';
        }
    }
免责声明 1:本站的课程与素材,都是电子版课件,非实物光盘,课件由百度网盘发送.(百度网盘下载教程)2:本站所有涉及视频及素材,软件等由互联网搜索收集而来,本站不拥有此类资料的版权。3:本站所有视频,素材及软件不加密、不限时、可永久观看或使用!禁止二次销售,否则因此引起的一切问题与本站无关。4:本站所有的资源均为免费提供,提供资料的目的是让大家学习和交流,所收取的相关费用非资料销售费用,而是资料收集整理手工费。5:无意侵害您的权益,请发送邮件至 590173@qq.com 或点击左侧 私信:站长反馈,我们将尽快处理。

给TA打赏
共{{data.count}}人
人已打赏
zibll主题美化

Zibll子比主题缩略图美化插件

2023-7-24 9:33:45

zibll主题美化

漂亮子比主题美化 – 自定义动态火置顶小标

2024-5-29 8:29:25

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索