Skip Navigation

[Resolved] Next and Previous Post to link within a Category and not entire product line.

This support ticket is created 4 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by hyukP 4 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1405057

I am trying to:
I would like the NEXT and PREVIOUS posts links "<" ">" to link to the next item in the category.
If there are 5 shoes in the Ashton category then it will only go forward and backward with those 5 shoes.
If there are 8 shoes in the Bailey category it will only go forward and backward with those 8 shoes.

Link to a page where the issue can be seen:
hidden link

I expected to see:
I would like to link within the categories.

Instead, I got:
The only option currently is the entire product line.

#1405195

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Your observation is correct and the way next and previous post link feature works in WordPress and Toolset, it cycles through the entire post type and not just posts attached to a specific category.

To achieve this, you'll need a custom shortcode that can get the next and previous post links from a view, using PHP code. You can create a view which returns the IDs of all the posts from a specific category and then only return the links for the next and previous posts, with respect to the current post.

This kind of custom shortcode will require a fail deal of familiarity with PHP code and for personalized assistance around customizations, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1427125

Thank you for the info and guidance. The client decided to go in another direction for this piece.

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