Skip Navigation

[Resolved] Return to search results button in content template

This thread is resolved. Here is a description of the problem and solution.

Problem:
I need to add functionality to return to the previous search results.
Solution:
Can you please try with following two solution:

1.

<a href="javascript:window.history.back();">Back to results</a>

2.

<a href="#" onClick="history.go(-1)">Back to results</a> 

If above not solve the issue then you can achieve it using ‘''HTTP_REFERER' in small shortcode:
http://php.net/manual/en/reserved.variables.server.php
Relevant Documentation:

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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by jasonH-5 6 years, 10 months ago.

Assisted by: Noman.

Author
Posts
#616743

Hello,

I am creating a job listing site with a CRED form to apply for a job. Once the user clicks "Apply" and is brought to the job application, I need to add functionality to return to the previous search results. Can you tell me how this is possible?

Thank you.

#616851

Noman
Supporter

Languages: English (English )

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

Hello Jason,

Thank you for contacting Toolset support. We have another client who had the similar issue and was also able to solve it, please take a look:
https://toolset.com/forums/topic/how-to-have-a-back-to-search-results-button/#post-360201

Thank you

#616991

This worked but when I do a parametric search using AJAX the url changes to something like this:

hidden link

When a post search result is clicked on the user cannot use the method to return to the search results as it loads a blank page.

#617403

Noman
Supporter

Languages: English (English )

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

Hello Jason,

Can you please try with following two solution:
1)

<a href="javascript:window.history.back();">Back to results</a>

2)

<a href="#" onClick="history.go(-1)">Back to results</a>

If above not solve the issue then you can achieve it using ‘''HTTP_REFERER' in small shortcode:
hidden link

Thank you

#618208

Solved. Thank you.