调用网站**文章:
<?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_permalink()(获取文章或页面链接) get_permalink() 用来依据固定衔接前往文章或许页面的链接。在获取...
wordpress评论中的头像是应用Gravatar的头像效劳(Gravatar民间注册地址:http://en.gravatar.com),用户的...
wp_list_categories 函数是 WordPress 中用来列举零碎中分类的函数,该函数领有许多管制输入的参数,明天忽...
Fatal error: Call to undefined method wpdb_2::delete() in /home/*/public_html/wp-includes/o...
update_user_option()函数 update_user_option()函数作用利用全局博客权限更新用户选项。 用户选项相似于用...
咱们都晓得,wordpress默许状况下会主动跳转到后盾规则的home_url下来,例如你的空间同时绑定了jb51.net和w...