Skip Navigation

[Resolved] Next and Previous – Sort order custom post type

This support ticket is created 6 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#618534

Hi,

I have created a view with a custom post_type, sorted by post title. Each post title is a link to the post itself. On those post pages, I've inserted links to the next and previous post. But I can't seem to find where to set the order of those. So the order of the next/previous differs from the view.

How do I change the order of the posts of this post_type to "sort by title"?

Kind regards,
Tim de Jong
Redduck

#618615

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Tim

It's not possible, I'm afraid.

The Views shortcodes wpv-post-previous-link and wpv-post-next-link are built on top of the native WP functions for next and previous links, and these are based on the post date and do not have options to order by an alternate field. (https://codex.wordpress.org/Next_and_Previous_Links)

What you want would require registering your own custom shortcodes for the next and prev links that get the list of posts with the same ordering options as your View and then generate the links. There is a link to something similar in the final section of that linked page.