调用网站**文章:
<?php
query_posts('showposts=10&orderby=new'); //showposts=10示意10篇
while(have_posts()): the_post();
?>
<li><a href="<?php the_permalink(); ?>"target="_blank"><?php the_title() ?></a></li> //这里能够写成你本人需求的款式
<?php endwhile; ?>
调用随机文章:
<?php
query_posts('showposts=10&orderby=rand'); //showposts=10示意10篇
while(have_posts()): the_post();
?>
<li><a href="<?php the_permalink(); ?>"target="_blank"><?php the_title() ?></a></li> //这里能够写成你本人需求的款式
<?php endwhile; ?>
调用某个分类下的**文章:
<?php
query_posts('showposts=10&cat=1'); //cat=1为调用ID为1的分类下文章
while(have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
扫除某个分类下的文章:
<?php
query_posts('showposts=10&cat=-1'); //cat=-1为扫除ID为1的分类下文章
while(have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
以上就是安达网络工作室关于《wordpress调用特定文章列表的技巧分享》的一些看法。更多内容请查看本栏目更多内容!
本文实例讲述了WordPress统计以后页面数据库查问次数及耗费工夫的办法。分享给大家供大家参考。详细剖析如下...
获取特定分类文章数 有时分咱们想获取某个分类(category)下的文章数目,以便在博客的某个中央显示进去。上面...
1.空间的抉择 wordpress要求 php+mysql的支持,rewrite性能,比方apache的mod-rewrite或iis rewrite。 空间...
让WordPress登录页的明码框显示最初一个输出的字符 在通常状况下,网页的设计者们会将明码输出框中的一切字...
要害字形容:工作 预备 装置   数据库 用户 创立 权限 应用 软件 解说 WordPress 的装置前的一些预备工...
尚未装置WordPress 在初始配置WordPress之前,将wp-config.php中的$table_prefix值(默许为wp_)修正为所需求...