wordpress调用特定文章列表的技巧分享

调用网站**文章:


<?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 文章列表
版权声明:本文为 安达网络工作室 转载文章,如有侵权请联系我们及时删除。
相关文章
在wordpress可视化编辑器中输出带缩进的代码

在WordPress中,咱们发如今写文章时,可视化模式下会对html代码进行清算,例如对<>等符号转化为html实体,对...

WordPress JQuery解决沙发头像

我想这对沙发同窗不太偏心吧。昨天在看yinheli同窗的《鼠标悬浮完成显示留言内容》一文(倡议看看,好文章)...

Wordpress之多备份插件应用办法

插件称号:多备份 插件下载:http://www.dbfen.com/tools/dbfen_wordpress_20141112.zip 第1步下载紧缩包后...

利用Fix Rss Feeds插件修复WordPress的Feed显示谬误

明天忽然有个网友留言说博客的Feed挂了,症状如下: Chrome间接关上订阅页面显示如下: This page contain...

WordPress修正新用户注册邮件内容的办法

本文实例讲述了如何修正WordPress新用户注册邮件内容,由于零碎发送的邮件是纯文本类型的,页面不太美观,又没...

WordPress获取以后页面URL地址的办法

本文实例讲述了WordPress获取以后页面URL地址的办法。分享给大家供大家参考。详细如下: 咱们常常在做WordP...

需求提交

客服服务

亿鸽在线客服系统