调用网站**文章:
<?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调用特定文章列表的技巧分享》的一些看法。更多内容请查看本栏目更多内容!
register_sidebar()(创立侧边栏) 建设一个侧边栏,用来搁置小工具。这个函数应用的时分请放在一个函数里,...
有些时分,在索引页中(首页、分类文章、标签文章、作者文章索引……)提行进入 WordPress 文章循环中( Lo...
get_post() 在普通主题制造时,get_post()函数咱们普通很少会用到,但由于前面会讲到get_posts(),所以咱们...
其次要用处是经过该办法, 完成后盾的生成菜枯燥用。 应用该性能之前,必需激活主题3.0+菜单性能。 办法如下...
本文实例讲述了Wordpress完成文章支持和拥护性能的办法。分享给大家供大家参考。详细剖析如下: 假如你上网...
之前我都是用二级域名的方式来存储图片、JS 和 CSS ,前些天在推特上的一位顺序员 yoursunny 通知我,光用二...