我有一个wordpress站点,其中包含以下custom_post_type父子结构:
Brand (main parent post)
Product (child post of Brand, but parent post for versions)
Version (child post of Product)
Version (child post of Product)
Version (child post of Product)
...每个版本子post都有一个$price post_meta字段,具有不同的值。
我想在产品页面级别显示一个文本,上面写着"From $lowestPrice to $highestPrice“
我的问题是:
如何在所有版本子帖子post_meta字段中检索$price的最低和最高值,以便获得$lowestPrice和$highestPrice的build值
我知道wp_query或类似的东西可以工作吗?
我希望我说得很清楚:)
非常感谢您的帮助!
诚挚的问候,
克里斯。
https://stackoverflow.com/questions/51329611
复制相似问题