Skip Navigation

[Resolved] Manually select related post

This support ticket is created 3 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by dominiqueM-3 3 years, 5 months ago.

Assisted by: Jamal.

Author
Posts
#2101299

Tell us what are you trying to do?
Hello,
I am working on a product catalog.
In the single product page, I want to display related products.
The criterion would be that the associated products share the same product category (custom taxonomy term) as the current post category.
But I would like admin editors to be able to manually choose which related products to display from a list.

Is there a similar example that we can see?
Since it doesn't seem possible to create a relationship between posts belonging to the same custom post type, I searched the Toolset forum and found this tread:
https://toolset.com/forums/topic/need-to -create-a- custom-field-which-displays-links-to-related-messages-of-the-same-type /

It's quite old and I wonder if it is still relevant today? Or is there a better solution?

Thank you

#2101387

Hello and thank you for contacting the Toolset Support Forum.

I am sorry, but I could not find the ticket that you have referred to here. If you still have it on your bookmarks, can you share it again and I'll check if the solution on it is still relevant?

In the meantime, I'll suggest using an intermediate post type. Let's call it "Related Products". Then implement a one-to-one relationship from Products to "Related products", and a one-to-many relationship from "Related Products" to Products.
This way, a product can have only one "Related product" post. And that post can have multiple children's products. Then you can build a view that will display the products linked to the "Related Products" post, and you can put it inside a content template. Then display that content template by setting its context to the "Related product" post linked to the current product. Does it make sense? Let me know if you have further questions or if you need a concrete example, I would be happy to prepare it.

#2101421

Hi Jamal,

Thank you for your reply.
The forum article I was referred to should be available here:
https://toolset.com/forums/topic/manually-select-posts-to-show-in-view-and-related-posts-by-category/
https://toolset.com/forums/topic/need-to-create-a-custom-field-that-shows-links-to-related-posts-of-the-same-type/

Regarding the solution you are proposing, I must admit that you have lost me.
Do you mean, I have to create a Related Products custom post type with the same posts as the Products custom post type?

Regards

#2101717

Well, the solution suggested in that ticket is probably more efficient than the one I suggested. It is still relevant and will work for you with the current versions of Toolset plugins.

If you are unsure of how to implement it, allow me temporary access to your website and I'll try to help. Your next reply will be private to let you share credentials safely. Please take a database backup before sharing credentials.

#2101967

Hi Jamal,

Thank you for your support.
If you can handle it, let me try it alone.
If I encounter any difficulties I will allow myself to open a new ticket.

Regards

#2101969

My issue is resolved now. Thank you!