Zibll子比主题美化-首页排名榜样式美化

演示效果

Zibll子比主题美化-首页排名榜样式美化

教程如下

将一下的HTML代码放到自己的index.php里面 我目前是放到/wp-content/themes/zibll/index.php里面,放在<?php get_sidebar(); ?>之前

<div id="syphb" class="container list clearfix">
			<div class="ranking-item">
				<a   class="top-icon js-rank-bottom1">副业项目</a>
				<div class="class-box">
				    
				      <?php query_posts('cat=1597&showposts=5&orderby=views'); ?>
<?php while (have_posts()) : the_post(); ?>
				    
				    
				    
				    
				    <a class="class-item js-rank" href="<?php esc_url(the_permalink()); ?>" target="_blank">
					   <div class="num-icon num-icon<?php 	
									 ++$phnum1;
										   echo $phnum1; 
										?>"></div> 

											<span class="syphimg" >  <?php echo zib_post_thumbnail(); ?></span>
												
					   <div class="class-info">
						<div class="name"><?php the_title(); ?></div>
						<span class="badg b-theme badg-sm"><?php echo get_post_view_count('', ''); ?>热度值</span>
						
					   </div>
					</a>
					
				<?php endwhile;?> 
					
					
					
					
					
					
					
					</div>
				<a class="bottom-link js-rank-bottom">
					<span>榜单实时更新</span>
					<i class="imv2-chevrons-right"></i>
				</a>
			</div>
			
			
				<div class="ranking-item">
				<a class="top-icon js-rank-bottom2" >源码分享</a>
				<div class="class-box">
				    
				      <?php query_posts('cat=1599&showposts=5&orderby=views'); ?>
<?php while (have_posts()) : the_post(); ?>
				    
				    
				    
				    
				    <a class="class-item js-rank" href="<?php esc_url(the_permalink()); ?>" target="_blank">
					   <div class="num-icon num-icon<?php 	
									 ++$phnum2;
										   echo $phnum2; 
										?>"></div> 

											<span class="syphimg" >  <?php echo zib_post_thumbnail(); ?></span>
												
					   <div class="class-info">
						<div class="name"><?php the_title(); ?></div>
						<span class="badg b-theme badg-sm"><?php echo get_post_view_count('', ''); ?>热度值</span>
						
					   </div>
					</a>
					
				<?php endwhile;?> 
					
					
					
					
					
					
					
					</div>
				<a class="bottom-link js-rank-bottom">
					<span>榜单实时更新</span>
					<i class="imv2-chevrons-right"></i>
				</a>
			</div>
				<div class="ranking-item">
				<a   class="top-icon js-rank-bottom3" >游戏源码</a>
				<div class="class-box">
				    
				      <?php query_posts('cat=785&showposts=5&orderby=views'); ?>
<?php while (have_posts()) : the_post(); ?>
				    
				    
				    
				    
				    <a class="class-item js-rank" href="<?php esc_url(the_permalink()); ?>" target="_blank">
					   <div class="num-icon num-icon<?php 	
									 ++$phnum3;
										   echo $phnum3; 
										?>"></div> 

											<span class="syphimg" >  <?php echo zib_post_thumbnail(); ?></span>
												
					   <div class="class-info">
						<div class="name"><?php the_title(); ?></div>
						<span class="badg b-theme badg-sm"><?php echo get_post_view_count('', ''); ?>热度值</span>
						
					   </div>
					</a>
					
				<?php endwhile;?> 
					
					
					
					
					
					
					
					</div>
				<a class="bottom-link js-rank-bottom">
					<span>榜单实时更新</span>
					<i class="imv2-chevrons-right"></i>
				</a>
			</div>
			
			
			
			
		
		</div>

修改要显示的分类,第一个是分类ID,第二个是在首页出现几个

Zibll子比主题美化-首页排名榜样式美化

CSS代码(将下面的CSS代码放到子比后台-自定义CSS样式即可!)

/** 首页排行榜列表 **/
@media (max-width: 800px) {
    .ranking-item{
        width:100%!important;
    }
}
.syphimg{
    width: 90px;
    height:60px;
    
    margin-right: 5px;
}
.syphimg img{
       border-radius: 8px;
    
}
.list.clearfix {
  display: flex;
  justify-content: space-between;
    flex-wrap: wrap;
}

.ranking-item {
    margin:0 auto;
  position: relative;
  width: calc(33.333% - 10px );
  /* height: 400px; */
  /* margin-right: 10px; */
  /* margin-left: 10px; */
  background: #fff;
  /* box-shadow: 0 2px 6px 0 rgb(55 55 55 / 7%); */
  /* border-radius: 8px; */
  box-shadow: 0 0 10px var(--main-shadow);
  border-radius: var(--main-radius);
  margin-bottom: 20px;
}

a.top-icon.js-rank-bottom1 {
  display: block;
  width: 129px;
  height: 43px;
  line-height: 32px;
  position: absolute;
  left: 119px;
  top: -7px;
  background: url(/pic/ranking1.png) no-repeat center/100%;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

a.top-icon.js-rank-bottom2 {
  display: block;
  width: 129px;
  height: 43px;
  line-height: 32px;
  position: absolute;
  left: 119px;
  top: -7px;
  background: url(/pic/ranking2.png) no-repeat center/100%;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

a.top-icon.js-rank-bottom3 {
  display: block;
  width: 129px;
  height: 43px;
  line-height: 32px;
  position: absolute;
  left: 119px;
  top: -7px;
  background: url(/pic/ranking3.png) no-repeat center/100%;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
  text-align: center;
}

.class-box {
  margin-top: 60px;
}

a.class-item.js-rank {
  display: block;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.num-icon.num-icon1 {
  width: 50px;
  height: 27px;
  background: url(/pic/top1.png) no-repeat center/100%;
  margin: 0 12px 0 15px;
}

img.class-pic {
  width: 90px;
  border-radius: 8px;
  margin-right: 5px;
}

.class-info {
  width: 220px;
  font-size: 14px;
}

.name {
  color: #545c63;
  line-height: 20px;
  font-weight: 400;
  margin-bottom: 2px;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.price {
  color: #f01414;
  font-weight: 600;
  margin-bottom: 2px;
}

.study-num {
  color: #9199a1;
  font-weight: 400;
}

.num-icon.num-icon2 {
  background: url(/pic/top2.png) no-repeat center/100%;
  margin: 0 12px 0 15px;
  width: 50px;
  height: 27px;
}

.num-icon.num-icon3 {
  background: url(/pic/top3.png) no-repeat center/100%;
  margin: 0 12px 0 15px;
  width: 50px;
  height: 27px;
}

.num-icon.num-icon4 {
  background: url(/pic/top4.png) no-repeat center/100%;
  margin: 0 12px 0 15px;
  width: 50px;
  height: 27px;
}

.num-icon.num-icon5 {
  background: url(/pic/top5.png) no-repeat center/100%;
  margin: 0 12px 0 15px;
  width: 50px;
  height: 27px;
}

.num-icon.num-icon6 {
  background: url(/pic/top6.png) no-repeat center/100%;
  margin: 0 12px 0 15px;
  width: 50px;
  height: 27px;
}



a.bottom-link.js-rank-bottom {
  width: 120px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  font-size: 12px;
  color: #fff;
  line-height: 12px;
  font-weight: 500;
  background-image: linear-gradient(270deg,#ff4f39 0,#fd6400 100%);
  border-radius: 12px;
  margin-bottom: 20px;
}

/** 首页排行榜列表结束 **

然后将下载的图片资源放在网站根目录下

资源下载

https://pan.quark.cn/s/d44719c4bb3b

1 如果您喜欢本站,点击这儿捐赠本站,感谢支持!

2 这些信息可能会帮助到你: 下载帮助 | 报毒说明 | 进站必看

3 修改版本安卓及电脑软件,加群提示为修改者自留,非本站信息,注意鉴别;

4 本网站部分资源来源于网络,仅供大家学习与参考,请于下载后24小时内删除;

5 若作商业用途,请联系原作者授权,若本站侵犯了您的权益请联系站长进行删除处理;

6 作者:网站编辑,如若转载,请注明出处:https://www.lkuba.com/627.html

(0)
上一篇 2024年4月14日
下一篇 2024年4月14日

相关推荐

发表回复

登录后才能评论