【发布时间】:2019-01-29 15:47:31
【问题描述】:
我有一个自定义帖子类型,其中包含多个属性, 比如价格 颜色制作模型等。
希望 Wordpress 打印其中的帖子数量。
我当前的代码是这样的
// Get total number of posts in "vehiclestock" post type
$count_vehiclestock = wp_count_posts('listings');
$total_vehiclestock = $count_vehiclestock->publish;
echo $total_vehiclestock . ' listings. ';
我附上了一些例子来更好地解释我自己。 因为我不知道要搜索什么来回答我自己的问题
【问题讨论】: