<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函数的使用方法 禁止输出指定类别的文章》的一些看法。更多内容请查看本栏目更多内容!
目前本站曾经有300多篇日志和超越2000条评论,尽管数据量不是很多然而偶然会呈现,404或许是500亦或是502谬...
用到了WordPress性能函数Query_post()的一种初级用法,就是获取本周或当月或最近30天评论最多的肯定数量的日...
要害字形容:装置 进程 如何 Wordpress   // 目录 define 文件 WordPress装置前的预备工作,如今咱们来...
WordPress 自身以及主题和插件通常需求加载一些 JavaScript 来完成某些非凡性能。为了最大限制地保障兼容性...
本文实例讲述了WordPress评论制止针对指定内容全英文的办法。分享给大家供大家参考。详细剖析如下: WordPr...
对搜寻引擎暗藏特定的文章 这个成绩的起源是这样的: 家喻户晓,随着搜寻引擎的改进,会越来越排挤采集和伪...