wordpress如何获得热门文章列表?
在WordPress中,你可能想要调用指定文章的集合列表。这个功能怎么实现?下面是实现方法,供大家参考。
推荐:WordPress教程
首先,你需要知道query_posts函数。该功能是对文章进行搜索、选择和排序,然后在循环回路中使用所选择和排序的文章。例如:
代码如下所示
lt;?服务器端编程语言(Professional Hypertext Preprocessor的缩写)
query _ posts(# 39;posts _ per _ page = 10ampignore _ sticky _ posts = 1amporderby = rand # 39);
while(have _ post()):the _ post();
回声# 39;lt;ligt#39;;_ title();回声# 39;lt;/ligt;#39;;
endwhile
WP _ reset _ query();登录后复制
