wordpress另类侧边栏调用热门排行榜的方法

IT资讯
IT资讯
IT资讯
1162
文章
239
评论
2019-08-1805:18:46
评论
1,853 985字

代码如下:

<h4><i class="fa fa-window-minimize fa-rotate-90"></i>热门排行榜</h4>
<ul id="work_list_hot">
<?php 
query_posts('cat=2&showposts=10&child_of=0&orderby=meta_value_num&meta_key=views');
while(have_posts()): the_post();
?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_title();?></a></li>
<?php endwhile; ?>
</ul>

 

样式如下:

div.work_hot_list h4 {
    font-weight: bold;
    line-height: 25px;
    margin-bottom: 1em;
    display: flex;
    align-items: Center;
}
 
 
ul#work_list_hot {
    list-style-type: none;
    counter-reset: sectioncounter;
}
 
 
 
ul#work_list_hot li {
    margin-bottom: 1em;
    display: flex;
    align-items: Center;
}
 
 
ul#work_list_hot li:before {
    content: counter(sectioncounter);
    counter-increment: sectioncounter;
    background: #ffa100;
    width: 20px;
    height: 20px;
    border-radius: 10px;
    margin: 0;
    padding: 0;
    float: left;
    margin-right: 10px;
    text-align: center;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: Center;
}
 
 
.et_pb_widget a {
    color: #666;
    text-decoration: none;
}

 

 

前端显示模式如下:

wordpress另类侧边栏调用热门排行榜的方法

  • Copyright ©  PC在线云端  版权所有.
  • 转载请务必保留本文链接:https://nrcs.xyz/web/wordperss_code/8401.html
WordPress 使用 Github & JsDelivr 加速静态文件 WEB技术

WordPress 使用 Github & JsDelivr 加速静态文件

一个网站的打开速度至关重要,会直接影响搜索引擎排名和用户体验。如果您的网站加载越慢,用户离去的就会越快,而用户又是我们生存的根本。 当然网站加载速度受很多因素影响,今天我们使用 Github &...
Orgorg速率最高可达1000Mbps,流畅观看Youtube 4K、TikTok,支持 Windows、Android、iOS、Mac,支持 微信、支付宝 付款!
全球数据中心,多点BGP保证速度,无视晚高峰,全天4K秒开,IPLC专线无惧封锁
全IEPL /青云跨境,高峰时期稳定8K播放,流媒体影视, ChatGPT 解锁保障,客户端无日志保护您的隐私安全,稳定运行5年+
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: