<?php
$args = array(
'category_name' => '栏目名称',
'showposts' => '10', //文章条数
);
$cn_posts = new WP_Query($args);
if ($cn_posts -> have_posts() ) :
while ($cn_posts -> have_posts() ) : $cn_posts -> the_post();
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
endwhile;
endif;
wp_reset_postdata();
?>
wordpress建站,不要第三方插件实现图片自动添加水印(亲测有效)
wordpress建站,如何实现多个网站调用的文章图片来自同一个文件夹
上面是“wordpress用栏目名称(category_name)调用指定栏目下的文章”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_14881.html
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

推荐一个高质量的图片素材网站——Unsplash
vue3如何做一个axios简易封装
交换网站链接的基本原理是什么?
Ima Claw官网入口,集成40种AI模型,可实现图片、视频、音乐的全链路创作 














