Skip Navigation

[Resolved] Sorting order of relationship post type items

This support ticket is created 5 years, 7 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 22 replies, has 5 voices.

Last updated by Minesh 3 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1106584

Minesh
Supporter

Languages: English (English )

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

Well - could you please share problem URL where you added your view and access details so I can check how you configure your view to display the content with your desired author sort order.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1107496

Hello,

Thanks for the details, I can login your website, will update here if there is anything found

#1107499

Here are what I found:

Custom field "Author sort order" is registered to Intermediary Post type "auteur-tijdschrifart", but you are using view to query posts of post type "Author", there aren't "Author sort order" fields in "Author" posts, so it conduct the problem: "No item found"

I have done below modifications in your website:
1) Edit he post type "auteur-tijdschrifart", enable the option "openbaar_zoekbaar".
hidden link

2) Edit the view "article-authors-new"
hidden link
- in section "Inhoudselectie", choose post type "Auteurs Tijdschriftartikelen Intermediary Posts"
- in section "Query Filter", change the filter to:
Select posts in a Auteurs Tijdschriftartikelen relationship that are related to the Post where this View is shown.
- in section "Loop Editor", use below shortcode to display the "Author" post title:
[wpv-post-title item="@auteur-tijdschrifartikel.parent"]

Please test again, check if it is fixed, thanks

#1107596

Jim

Wow, thanks Luo!
I think this works like a charm!

I cannot follow axactly what you did to everything but maybe I don't have to...
Is there a tutorial about this somewhere on the website that I can follow to learn more about this?

Another question is this:
The intermediary post type "Auteurs Tijdschriftartikelen Intermediary Posts" is only needed as the connection and the connection is automatically made when we add authors to the article post type right?
But now this intermediary post type is listed in the wordpress left menu in the backend. Is it possible to hide it from there? Or is there any reason why not to hide it?

Thanks,
Jim

#1108095

In your case, it needs to query the child posts of Intermediary Post type "auteur-tijdschrifart":
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

In the view's loop, display the parent "Author" post information:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent

And you can hide it from wordpress left menu in the backend:
hidden link
Edit the Intermediary Post type "auteur-tijdschrifart", in section "Options", disable option "show_ui"

More help:
https://developer.wordpress.org/reference/functions/register_post_type/
'show_ui'
(bool) Whether to generate and allow a UI for managing this post type in the admin. Default is value of $public.

#1108129

Jim

Excellent!
Thanks ver y much for all your help

#1988821

Hi, - is this sorting now realized? I need it. - That means: Sorting related Post in CPT in Backend to show this in Frontend.

best regards - alex

#1988823

Minesh
Supporter

Languages: English (English )

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

Hi alexed-6:

Please open a new ticket with every new question you may have in order to get quick support as this ticket is already resolved.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.