本文整理自网络,侵删。
调用网站最新文章:
代码如下:
<?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主题支持自定义菜单及修改css样式实现方法
优化wordpress分类链接及wp-no-category-base的卸载方法
ubuntu vps中wordpress网站打开时提示”建立数据库连接错误”的解决办法
wordpress中给媒体文件添加分类和标签的php功能实现
更多相关阅读请进入《wordpress》频道 >>
相关推荐
评论
管理员已关闭评论功能...
- 欢迎访问木庄网络博客
- 可复制:代码框内的文字。
- 方法:Ctrl+C。