• Resolved jonny-s

    (@jonny-s)


    Hi all,

    situation: several post-types (e.g. “post” and “calendar”) have its taxonomies.
    question: make these taxonomies act together like a unique one. So that taxonomies are organized equal for all regarding post-types (hierarchy, descriptions etc.) and do link to the same page, where all post of one taxonomy are displayed in different sections (e.g. print events for “peace”-taxonomy at top of the page and underneath all posts of “peace”). How to achieve that?
    thoughts:

    • I want to use an existing calendar plugin (in my case modern event calendar), so just adding calendar-capability by custom-field to “post”-post-type isn’t an option. – Or is there any way to kind of redirect the calendars post-type-management from post-type “calendar” to “post”? Then I could separate it’s printing at page by custom-field “is-event”.
    • When write some kind of synchronize-hook listening to taxonomies getting modified and sync them vice-versa, I stuck to the problem of getting the taxonomies link to the same page. – Or is it enough to set up all same taxonomy-slug and get the output of both post-type-taxonomies handled by a theme?

    I still haven’t written any theme or plugin and just got a first insight into PHP, so I wanna KISS.

    Any help about how to realize that will be appreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Go download the plugin PODS and you will have a hay day. It will allow you to really expand what you are trying to do with far greater control than you could ever hope… They also have an extension or PODS as well I believe.

    But what you are trying to do is a few clicks of a button with PODS.

    • This reply was modified 4 years, 5 months ago by c1ayton12.

    Note: What you will be looking to do is find “Relationships”. You can create a taxonomy or each custom post type or use the same one for multiple post types. How you link the taxonomy to a certain post type is the “Relationships” option.

    PODS can do everything. It’s over my head, I am not an expert. I just know that what you are looking to do can all be done with PODS. They do have great tutorial videos that will help you along I am sure. Someone with knowledge of wordpress there is not really a more flexible plugin. You can extend a custom post type created by another plugin. Like the calendars you are talking about. You would go find that post type in PODS by clicking on “Extend existing post type” find calendars post type that you are talking about.

    And then add a field to it, taxonomy. You can create a new taxonomy or add an existing. You can have 1 taxonomy be tied to multiple post types. Best bet is to download pods and then go watch their videos. They have hundreds of videos because of how much you can do. You might add the buddyforms extension for PODS first, and then see what is possible with it. I have not tried that.

    • This reply was modified 4 years, 5 months ago by c1ayton12.
    • This reply was modified 4 years, 5 months ago by c1ayton12.
    Moderator bcworkz

    (@bcworkz)

    PODS offers you great flexibility. Alternately, get exactly what you need and nothing more with some simple custom code.

    The post type to taxonomy relationship is normally established when the post type or taxonomy is first registered. However, a relationship that is currently lacking between existing types and taxonomies can still be established with register_taxonomy_for_object_type().

    Once this is done, the appropriate back end UI elements for the post type are added for the respective taxonomy. Thus you can assign taxonomy terms to that post type as usual. Nothing needs to be “synchronized”, WP will handle assignments correctly on its own. Whether this affects what is shown for front end requests is somewhat variable. If you are not getting what you want for front end requests, you can alter a request’s query vars through actions like “pre_get_posts“.

    Thread Starter jonny-s

    (@jonny-s)

    Thanks a lot!

    register_taxonomy_for_object_type() was what I was looking for.

    PODS can link taxonomies in relationsships, but I didn’t got it to make wordpress treat the existing taxonomies as a single one.

    Have a nice day.

    @jonny-s That’s also exactly what I was looking for.
    Thank you so much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to share taxonomies in-between different post-types’ is closed to new replies.