Skip Navigation

[Resolved] same type related posts

This support ticket is created 4 years, 5 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Shane 4 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#1673033

I want to select and view posts that are related to same-type posts. From this thread: https://toolset.com/forums/topic/related-posts-5/ I learn this is not possible by using relationships. I do not want to rely on taxonomies as suggested in the referred thread but I want to do the selection manually, ideally in a similar way as in case of relationships between different CPTs. Is there a relatively easy way to do this?

#1673721

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Joost,

Thank you for getting in touch.

Did you already setup the same type post relationship using our Types plugin ? If so can you confirm that you only want to use views to display them ?

Thanks,
Shane

#1673817
Knipsel.PNG

No, I have not set up a same type post relationship yet. That is exactly what I'm struggling with.

To make it more specific, I want to create links between instances of the standard WP Post type to guide visitors to "Related Topics". I've done so in the past with Yuzo, but I expect I could do this with Toolset as well.

I've no problem setting up up relationships between different post types. But if I try to make a many-to-many relationship and select "posts" as the first posttype, it is disabled for selecting as second posttype. See the screenshot. If find the same for other relationship types and CPTs.

What do I miss?

#1673919

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Joost,

To create a same post type relationship you will need to enable the hierarchical attribute in your post type settings. Go to Toolset -> Post Types and edit your post type. The hierarchical settings should be under the Options tab.

Once you've done this we can go to the next step.

Thanks,
Shane

#1674627

Hi Shane,

I've tried to do so. However, this option seems to be unavailable for the standard WP Post type, only for CPTs. As mentioned, my use case is about the standard WP Posts. Nevertheless, for learning purposes, I've set it for a CPT, and have enabled Page Attributes for this CPT. I don't see any new option appearing, so what would be next? I'm curious how adding hierarchy would help me, as I do not see any logical hierarchy between the posts that I want to link (they would link mutually).

But if this is not going to work for the built-in WP post type, what are other options to achieve a list related posts? I can imagine adding extra fields to posts where I can manually enter Post IDs and create a view using these IDs. Not very user friendly, but perhaps it would be usable. Would that work? Any other route?

Joost

#1675039

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Joost,

For the Default post types it is not possible. This type of relationship will only possible on Custom Post types and the Default Pages for wordpress.

Once you've enabled the "hierarchical" option you will then need to enable the "Page Attributes" option in the "Sections to display when edit..."

When you've done this you will get the Page Attribute section in the sidebar of the Edit page for your post where you will be able to assign your parent post.

Thanks,
Shane

#1678693

Hi Shane,

Thanks, I understand what you mean. However, I'm afraid this does not solve my requirement. As I understand it, this workaround allows me to create one-to-many relationships: one parent post with many child-posts. But the posts I want to refer to, could be referred to by several posts. So I need a many-to-many relationship functionality.

The only possible way out I see is, as a mentioned earlier in this thread, to add extra fields to posts in which I manually add the Post IDs I want to refer to and create a view for them. Not elegant, but perhaps doable. Would this indeed the best approach? Other suggestions?

#1680779

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Joost,

Thank you for the clarity.

Unfortunately, no this won't be possible with any of the default mechanisms or wordpress or our Toolset plugins and many to many relationships are only possible through Multi Post Types and not a single post type relating to itself.

As you mentioned you will definitely need to do this manually by populating a custom field with the ID of the parent data. I would suggest using a single line field and use comma separated ID's when you are entering them into the field.

Thanks,
Shane