
<?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入门, wordpress文章调用
上面是“wordpress用栏目名称(category_name)调用指定栏目下的文章”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_14881.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

 Pear Admin Layui中文文档官网介绍
 一款精准识别AI生成内容,守护学术诚信的AI工具——知网个人AIGC检测服务
 AO3网页版官方入口,汇聚各种小说和原创作品网