Disable Relevanssi for Custom Search Template, or fix my misconfig?
-
Hello,
I am using Relevanssi Premium 1.13.4. I have a problem with a custom search template + custom post type + relevanssi. How can I escape Relevanssi on a custom search template?
My site has a global search input that uses “search.php” to return many custom post types very well, including authors (users) at
/?s=[thesearch]
… no problems there.I am also using a custom form with inputs that run custom searches for the “current-opening” custom post type (searching jobs on our site):
page-careers.php contains:
<input type="text" name='s' value="" placeholder="" /> <input type="submit" value="Go" /> <input type="hidden" name="post_type" value="current-opening" />
/?s=[thesearch]&post_type=current-opening
Searches through that form go to search.php, but I have a script on search.php that looks for “current-opening” in the URL and does a
get_template_part('search', $post_type);
to send the search on to a custom template, search-current-opening.phpsearch-current-opening.php works fine if Relevanssi is turned *off* — it just returns the “current-opening” post type stuff — the title, some custom fields.
But, if Relevanssi is turned *on*, it returns the user info instead of current-opening post type info, like “John Doe” instead of the_title(), the permalink and doesn’t return any custom fields … because authors/subscribers don’t share any custom fields with current-openings
Turn Relevanssi off and everything’s fine.
Any ideas? I’ve been scouring the Internet trying to figure out how to disable Relevanssi for this particular custom search template, but nothing works. The only thing that works is turning off Relevanssi, but then I can’t use it on my main search
Thank you,
CSPS: I would show you, if you wanted to see, but I don’t have this on a dev or production site, all local.
- The topic ‘Disable Relevanssi for Custom Search Template, or fix my misconfig?’ is closed to new replies.