调用网站**文章:
<?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调用特定文章列表的技巧分享》的一些看法。更多内容请查看本栏目更多内容!
get_template_part() 用来援用模板文件,相似于 get_header()、get_sidebar() 和 get_footer(),只不过这个...
编写WordPress插件和主题的时分,常常需求用到cookie,比方存取用户形态等,我之前编写的插件Ludou Simple ...
最近关上博客后盾,发现后盾关上速度很慢。 经过开发者调试工具对网络加载进行检测,发现是因为后盾应用了谷...
一、导入数据库提醒数据表已存在 以周良博客应用的主机商-主机91为例,提供了phpMyAdmin性能的,导入数据库...
首先关上网站根目录下的 wp-config.php,而后搜寻 define('WPLANG' 就能够疾速定位到言语设置那里 比方简体...
查看相干教程,UTF-8和UTF-8 + BOM有所区别,于是把function.php编码改为后者。成绩处理。 UFT-8 与UTF-8 B...