首页 WordPress小工具代码浏览量调用热门文章代码

WordPress小工具代码浏览量调用热门文章代码

沐辰客栈 2022-03-07 07:23:46 0 83
<ul class="My_Widget_zuixinpinglun">
  <?php 
  global $post;
  $i="1";$b="1";
   $args=array(
         'meta_key' => 'views',
         'orderby' => 'meta_value_num',
         'posts_per_page'=>9,
         'order' => 'DESC'
    );
    query_posts($args);  while (have_posts()) : the_post(); $d=$i++; $c=$b++; if($d>3) $d=4; ?> 
<li ><span class="layui-badge bg-red-<?php echo $d; ?>"><?php echo $c; ?></span><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php  the_title(); ?></a></li> 
 <?php endwhile;wp_reset_query();?>
    </ul>
css · wordpress ·

发表评论