Skip Navigation

[Resolved] Adding post relationship based on taxonomy or category

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1119992

Hello,

I'd like to know if it's possible to add post relationships in bulk using a taxonomy for example.

Right now, I have over 400 lessons from the same coach already published.

I've created a CPT for Coaches and for Lessons but if I have to do it one by one, it's going to take forever.

Also, it would mean that evry time we add a new lesson, we have to add manually the post relationship. Not very convenient...

#1120845

Hi, there's only one way to do this in wp-admin, and it involves importing post content with a CSV file. This method doesn't involve any extra code, only an understanding of CSV files and some patience. We have some documentation about this method available here: https://toolset.com/documentation/user-guides/importing-content-from-csv-with-post-relationships/

As an alternate method, using the WordPress API and Toolset Post Relationships API you can write custom code that loops over all the posts and connects them as needed. We have some documentation about programmatically connecting posts here: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
The information for the WordPress API to query posts is available here:
https://codex.wordpress.org/Class_Reference/WP_Query
This method would require knowledge of PHP.

Let me know if you have questions about either method and I'll be glad to give you more details.