调用网站**文章:
<?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调用特定文章列表的技巧分享》的一些看法。更多内容请查看本栏目更多内容!
1. 自定义主题图片大小 图片是WordPress主题的重要组成局部,但开发者们有时会忘了对主题图片进行优化。主题...
明天在网页上传图片到博客,后果提醒:“无奈将上传的文件挪动至 /home/wwwroot/wp-content/uploads/2013/”...
1、修正文章页面模板single.php关上模版文件中的single.php,在其中搜寻在这行上面加上:复制代码代码如下:...
装置SAE上的wordpress,创立使用抉择wordpress模板,装置后是3.4版本 新建一个版本2,下载最新wordpress装置...
前言 最近在应用WordPress的时分遇到了一些谬误提醒,置信大家在应用wordpress建设网站的时分,都会遇到一些...
本文实例讲述了wordpress晋级后明码正确后盾无奈登陆的处理办法。分享给大家供大家参考。详细剖析如下: 明...