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

plugins - Permalink URL connection between two custom types

programmeradmin1浏览0评论

We use latest WP 5.2, and the super plugins Advanced Custom Fields Pro (ACF Pro) and CPT UI. In our website taxonomy, we need to have events, within which we have talks and workshops.

Example structure:

Event 1
  |__ Workshop A 
  |__ Workshop B 

Event 2
  |__ Workshop C
  |__ Workshop D 

We have therefore setup two custom post types: Events, and Workshops. We first create events. Then, when creating each workshop, we have a custom-field association with a related field and can thus create workshops within each event. In other words, each workshop is associated with a pre-created event. This works beautifully and ACF Pro is a stellar help.

However, the URLs created by Wordpress follow the custom posts as if they're unrelated:

/events/event-1 
/events/event-2 
/workshops/workshop-a
/workshops/workshop-b

What we'd like is to manifest the association in actual permalink URLs:

/event-1/workshop-a
/event-1/workshop-b
/event-2/workshop-c
/event-2/workshop-d

I found some questions on the site related to this, but they're either too localized, or deal with the wp_query inside already working permalinks, or have 0 answers. Any ideas how to set this up in Wordpress? Many thanks.

发布评论

评论列表(0)

  1. 暂无评论