I have a site with different custom post types, I have two "index pages" for each one of these (where I query the posts and show) and also I include a search form on both of them. So the thing is that search forms goes by default to the search.php template, to filter search and show results only for that custom post type I'm using a hidden field on form:
<input type="hidden" name="post_type" value="staff" />
but then on the search I'd like to provide a "back" link to allow the user to go back to the index page, the thing is that I can't find an if statement that works to show different "back to" links depending of the custom post type searched.
Example: If I search for News then I'd like to have a back to News index button If the search is on Staff the button shown has to be back to Staff index.
I appreciate any help guys!