Skip Navigation

[Resolved] Manually add some related posts

This support ticket is created 2 years, 8 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)

This topic contains 22 replies, has 3 voices.

Last updated by dominiqueM-3 2 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#2341935

Hello Minesh,

Idealy, it would be great if related posts could be ordered by the order applied to the instances of the custom field (by drag an drop).
Do you think it is possible?

Thank you

#2341957

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

For instance with the following post:
- hidden link

How you want to display the results, 167 and 52 or 52 and then 167.

Can you set order with 3-5 Ids and tell me in what order you want to display the result.

#2344407
Capture d’écran 2022-04-19 100201.png

Hello Minesh,

Really sorry for my late reply.

I've created 3 more test articles (hidden link).

This one - hidden link - has 4 related posts:
ID181, ID50, ID52, ID167.

What I would like, is to have the related articles in the right column in the same order as the one in the custom field (please see attached screen).

I noticed that the desired order is that of the field displayed in the custom template ([types field='insight-related-post-id' separator=', '][/types]), before the post title.

Thank you

#2345495

Shane
Supporter

Languages: English (English )

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

Hi Dominique,

As Minesh is currently unavailable due to vacations days I will be handling this thread for him.

Unfortunately no it won't be possible to retain the sort order as depicted in your custom field. This is because the sortable attribute from this post field is not present on the post itself.

What I mean is that you can only sort the view based on the attributes of the post itself.

Please let me know if this provides some clarity for you.
Thanks,
Shane

#2345843
Capture d’écran 2022-04-21 094639.png
Capture d’écran 2022-04-21 094712.png
Capture d’écran 2022-04-21 094901.png

Hello Shane,

Thank you for your support.

Just to be sure before closing this topic, I would like to notice that the order of the IDs is reflected when the field is displayed in a content template in my case.
Isn't there a clue for a solution to manage related posts order?

Regards

#2346213

Shane
Supporter

Languages: English (English )

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

Hi Dominique,

I did some more reading on this one for you to see if we can actually perform the sorting.

The good news is that I was able to get it to work when I adjusted the orderby settings in the view hook to sort the values by the direct list that is being provided to the view.

It should be fine now. Can you confirm this on your end.

Thanks,
Shane

#2346227

Hello Shane,

I've tested. It is working well.
Thank you very much to Minesh and you.

May I suggest asking the Toolset dev team to add equivalent functionality (in a more convenient way than manipulating IDs).
I think a lot of users need to be able to link articles manually or of the same content type.
Adding options that go along with this when creating a View would be really great.

#2346229

My issue is resolved now. Thank you!