<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函数的使用方法 禁止输出指定类别的文章》的一些看法。更多内容请查看本栏目更多内容!
update_user_option()函数 update_user_option()函数作用利用全局博客权限更新用户选项。 用户选项相似于用...
上面引见四种WordPress 显示文章摘要办法: 一、应用WordPress自带摘要性能 我目前另一WordPress博客就是应...
WordPress根本模板文件 一套完好的WordPress模板应至多具备如下文件: style.css : CSS(款式表)文件 index....
复制代码代码如下:<title><?php if ( is_home() ) { ?><?php bloginfo('name'); ?> | <?php bloginfo('...
本文实例讲述了WordPress增加前台注册性能的办法。分享给大家供大家参考。详细剖析如下: WordPress属于集体...
要害字形容:特点 次要 WordPress 能够 链接 公布 文章 博客 进行 WordPress 的次要特点。WordPress 有很多...