dongmou2389 2015-08-25 14:23
浏览 32
已采纳

自定义帖子的分类标准设置为其他自定义帖子?

Is it possible to set/connect first custom post's taxonomy (values) to other custom post?

Just random and basic example to understand a little better:

  • First custom post: jazz concerts
  • Second custom post: places to crash/sleep for night
  • Both custom posts has it's own taxonomies and post_metas, for example: location, price etc.
  • Now we need a connection between posts & taxonomies so that you find most nearest locations to crash if you are going to jazz concert - that can probably be done by WP_query & I got this.

I've never seen anything like that in stackoverflow or in WP docs. I tried but it was too long, complicated, didn't make any sense and generated infinite errors & I thought I ask before trying again, maybe someone has been dealing with this kind of situation.

Do I just need to name taxonomies and post_meta differently and get them to query same way as post's own taxonomy and post_meta? And all same from here?

How to get other post's taxonomy/post_meta dropdown box or other types of inputs to admin edit page?

I hope that I expressed myself clearly. If there's any confusion or questions, let me know & I'll provide additional information or explain something in more depth.

  • 写回答

1条回答 默认 最新

  • duangang79177 2015-08-26 08:00
    关注

    You can register a taxonomy against several post types: link in the second parameter of register_taxonomy() you can provide an array of post types. Those post types will then have the same taxonomy.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?