本文整理自网络,侵删。
调用网站最新文章:
代码如下:
<?php
query_posts('showposts=10&orderby=new'); //showposts=10表示10篇
while(have_posts()): the_post();
?>
<li><a target="_blank"><?php the_title() ?></a></li> //这里可以写成你自己需要的样式
<?php endwhile; ?>
<?php
query_posts('showposts=10&orderby=new'); //showposts=10表示10篇
while(have_posts()): the_post();
?>
<li><a 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 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 target="_blank"><?php the_title() ?></a></li> //这里可以写成你自己需要的样式
<?php endwhile; ?>
调用某个分类下的最新文章:
相关阅读 >>
wordpress高级自定义布局的内容编辑器(tinymce)模板
详解wordpress中调用评论模板和循环输出评论的php函数
wordpress 相册插件 nextgen-gallery 添加目录将中文转为拼音的解决办法
更多相关阅读请进入《wordpress》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。