最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - Get taxonomy values based on wp_query results

programmeradmin2浏览0评论

We are building an extension for displaying vacancies. On the overview page of the vacancies we display filters (taxonomies) which are used for filtering the results. We do this by adding a tax_query to wp_query. This works fine for the results but we only want to display the taxonomies/taxonomy value in the filter list if it exists in the result-set. So, if we for example filter on "Region" = "Canada" we do not want to display the other regions since they do not exist in the result-set. So, I would like to count the taxonomy/taxonomy-value from the wp_query results and only display as filter if > 0. Only, I cannot find a way to do this. So bottomline I would like to get taxonomies/taxonomy values based on the result of wp_query. Any tips?

发布评论

评论列表(0)

  1. 暂无评论