php - 我如何获得自定义帖子类型类别项目 Wordpress
问题描述
我的代码是获取所有投资组合项目,但我只想要一个类别项目。
这些是我的类别。 http://prntscr.com/mzzjfy
感谢和抱歉我的语言不好。
<?php
$args = array(
'post_type' => 'dt_portfolio',
'orderby' => 'meta_value',
'order' => 'ASC',
'posts_per_page' => '50',
);
$rhy_query = new WP_Query($args);
while ($rhy_query->have_posts()): $rhy_query->the_post();
the_title();
endwhile;
?>
解决方案
推荐阅读
- android - JobScheduler 每 15 分钟执行一次
- javascript - 关闭切换时“返回”内容
- webpack - 升级到 vue-cli 3 后,HTML 中的空格消失了
- http - 谷歌云打印使用哪种 HTTP 方法?
- html - 如何使用 React 提供多个 HTML 文件?
- docker - 将 Redash 集成到 Docker 容器中
- mysql - 如何从MYSQL中的外部IF语句退出
- webpack - React-Leaflet 与 Gatsby
- c# - 获取 NotSupportedException:不支持指定的方法。NHibernate C#
- asp.net - 如何防止 Asp.net 中的会话劫持