zoukankan      html  css  js  c++  java
  • 板邓:wordpress调用热门文章排行代码WP-PostViews

    板邓网上找了很多文章,代码都很复杂,不适合新手使用,下面板邓分享最简单方式就可以实现热门文章调用:

    1、安装插件 WP-PostViews,设置好。

    调用代码如下:

    <?
    $args=array(
    'numberposts'=>8,
    'orderby'=>'meta_value_num',//按点击量排序
    'meta_key'=>'views'
    );
    $rand_posts=get_posts($args);
    foreach($rand_posts as $post){
    setup_postdata($post);
    
    ?>
    
      <ul >
        <a href="<?php the_permalink(); ?>" title="<? the_title(); ?>"><?php the_title(); ?></a>
        <? echo the_views(true, '阅读(&nbsp;','&nbsp;)次','true');?>   </ul> <?}?>
    板邓个人博客:http://8dseo.com
  • 相关阅读:
    [UE4]Image
    [UE4]CheckBox
    [UE4]Button
    [UE4]Border
    [UE4]RichTextBlock
    [UE4]Text Box
    [UE4]字体材质
    [UE4]Retainer Box
    [UE4]Invalidation Box
    [UE4]Dynamic Entry Box
  • 原文地址:https://www.cnblogs.com/xbdeng/p/5597189.html
Copyright © 2011-2022 走看看