【非常推荐】子比主题美化 –文章角标多彩美化

 

【非常推荐】子比主题美化 –文章角标多彩美化插图
【非常推荐】子比主题美化 –文章角标多彩美化插图1

添加教程

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

       

    3. 打开子比主题文件夹下的inc/functions/zib-post-list.php文件,搜索 置顶 添加以下代码
      //添加在这个代码的下面
       if (is_sticky()) {
              $sticky = '<badge class="img-badge left jb-red">置顶</badge>';
          } else {
              $sticky = '';
          }
      【非常推荐】子比主题美化 –文章角标多彩美化插图2

      将以上代码下面添加以下代码:

      //列表图片封面右上角标
              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>';
              }
          }

      4.然后刷新看效果,本站首页已经在使用

       

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享