<p class="widget" id="diary1">
<h3>随机出现</h3>
<ul>
<?php
$args=array(
'numberposts'=>16,
'category'=>'-9,-12',
'orderby'=>'rand'
);
$rand_posts = get_posts($args);
foreach( $rand_posts as $post ) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</p>
$args=array(
'numberposts'=>16,
'category'=>'-9,-12',
'orderby'=>'rand'
);
<?php $args = array(
'posts_per_page' => 5,
'numberposts' => 5,
'offset' => 0,
'category' => '',
'orderby' => 'post_date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => 'post',
'post_mime_type' => '',
'post_parent' => '',
'post_status' => 'publish',
'suppress_filters' => true );
?>
以上就是安达网络工作室关于《wordpress get_posts函数的使用方法 禁止输出指定类别的文章》的一些看法。更多内容请查看本栏目更多内容!
要害字形容:特点 次要 WordPress 能够 链接 公布 文章 博客 进行 WordPress 的次要特点。WordPress 有很多...
应用Wordpress这么久不断很厌恶wordpress的文章修订和主动保留性能,也应用过超级开关插件能够制止wordpres...
普通而言,WordPress自身会对英语用户的体验进行优化,例如默许模板的分隔符永远都是“|”,由于...
建设多言语切换的网站有两种形式,一种是子域名方式,另一种则是子目录方式。而以这两种方式建站,中文站点...
咱们常见的WordPress站点文章排序,通常状况下是按公布工夫的升序或降序形式陈列,这种排序形式简直能够满足...
区分访客国度有什么用? 这里是几个我利用该性能的例子. 1.区分网站性能 这个博客有翻译文章的性能, 这是...