Types plugin lets you easily create relationships between different post types and connect them using GUI controls. You can also connect multiple post types and build many-to-many post relationships.
When you ask for help or report issues, make sure to tell us what you have created so far and the structure that you want to achieve.
Viewing 15 topics - 721 through 735 (of 845 total)
Problem: I would like to automatically connect multiple posts in a M2M relationship. The GUI lets me connect each post manually, but I would like to automate the process. I would like to query all the posts in one custom post type, which have one specific taxonomy term, and relate those posts to 3 specific posts from another custom post type.
Solution:
Create a backup of your site and database first. Then insert this code in functions.php. This code creates a shortcode which calls a custom get_posts query to get the posts in one specific category, and uses the toolset_connect_posts API to loop over each of those posts and connects it to all 3 posts in the other custom post type. Place the shortcode on a page, then load the page once in the front-end. Finally remove the code from functions.php and remove the shortcode from the page. Custom code follows:
Problem: I would like to loop over repeating fields in a parent post using wpv-for-each.
Solution: You should create a View that shows the parent post, then use wpv-for-each inside the View's Loop Output editor. The wpv-for-each shortcode is not designed to show fields from a parent post.
Problem:
With the changes in Types 3 the post relationship is no longer stored as post meta but in custom tables. How to import posts and maintain the relationships?
Solution:
There is a new solution to set up relationships when importing posts, described in the documentation.