Skip Navigation

[Resolved] Navigate through underlying pages within search results

This support ticket is created 5 years, 1 month 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 3 replies, has 2 voices.

Last updated by Waqar 5 years ago.

Assisted by: Waqar.

Author
Posts
#1219725

Bob

I want to be able to navigate (back - forward) through all pages within a certain search. If I use the standard WP option it just navigates through all pages form within a post type.

For example...

Here I define the search criteria: hidden link which would be distance and place.

On the underlying 'detail page' I would like to place a back and forward button that will navigate through the range defined earlier. Example: hidden link
Here I searched on 'Drachten' which shows me 8 results. Going back and forward should be limited to 8 profiles.

#1220167

Waqar
Supporter

Languages: English (English )

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

Hi Bob,

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

To restrict the next and previous item links on the single post pages (or detail pages), based on the visitor's search filters, you'll need to pass on the information from that view to those detail pages.

The best way to keep track of that information would be to use PHP global variable: $_SESSION:
hidden link

For example, you can create 3 custom shortcodes:
( ref: https://codex.wordpress.org/Shortcode_API )

1. First, one will be used to create a new array in the $_SESSION global variable before the loop in the view starts (i.e. above the shortcode [wpv-items-found] )

2. The second one can be placed inside the views individual loop item to set the current post's ID in that array.

3. The third one will need to be placed on the detail pages, which will get the array from that session array and show the links from the previous and the next post IDs accordingly.

I hope this helps and for more personalized assistance around custom code, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1220387

Bob

Hi Waqar,

Thanks for your guidance 🙂
I think I get the gist of it, but I'll have to do some reading up on the subject... so I'll put it on roll out phase 2 for now.

Thanks for now!
Bob

#1221083

Waqar
Supporter

Languages: English (English )

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

You're very welcome Bob and feel free to reach us anytime.

regards,
Waqar

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