WordPress如何调用最新、热门文章和指定分类文章

2020-06-20 0 713
资源下载
终身会员专享

WordPress如何调用最新、热门文章和指定分类文章

2020-06-20资源编号:1345DIV CSS7130
如侵权、投诉或获取更新,请联系作者处理
文章目录

在我们WordPress主题制作过程过用到最多的应该是调用文章的代码了,而根据主题功能需求的多样性,调用文章的需求也变得花里胡哨。

下面小白学习资源站分享了几段WordPress调用最新、热门文章的代码实例

 // 显示文章篇数和显示分类


<a href="" rel="external nofollow" >

 




<a href="" rel="external nofollow"  rel="external nofollow"  >


 'publish', // 只选公开的文章.
'post__not_in' => array($post->ID),//排除当前文章
'caller_get_posts' => 1, // 排除置顶文章.
'orderby' => 'comment_count', // 依评论数排序.
'posts_per_page' => $post_num
);
$query_posts = new WP_Query();
$query_posts->query($args);
while( $query_posts->have_posts() ) { $query_posts->the_post(); ?>

<a href="" rel="external nofollow"  rel="external nofollow"   >


 

文章来自小白学习资源站https://qyymz.com转载请保留本链接,谢谢!

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

千源源码站 DIV CSS WordPress如何调用最新、热门文章和指定分类文章 https://qyymz.com/14026.html

常见问题

相关文章

猜你喜欢
发表评论
暂无评论