- This topic has 5 replies, 3 voices, and was last updated 3 months, 1 week ago by Tom.
April 28, 2020 at 4:39 pm #1260395Michael
I didn´t find a solution yet.
I´m not sure if this is possible. I use two plugins to “pimp” the WordPress search.
Ivory Search and Relevanssi.
My question: is it possible to add a link to every entry of the search results page given for a specific search word so the viewer can visit the page where the search word appears?
Example: I type “geografie” and press enter. Now it redirects me to the search page. There are 3 results. At the moment it´s just text. I want to guide the user to the page where the search word is.
Can I achieve this with a GP filter?
MikeApril 29, 2020 at 8:33 am #1261435LeoStaffCustomer SupportApril 29, 2020 at 8:43 am #1261458Michael
Thanks for your answer.
I guess I asked way to complicated.
I found a solution. What I was looking for is basically a customized search template in a child theme.
To solve my problem I just created a GP child theme and tweaked the search.php file with that code:
<?php while ( have_posts() ) : the_post(); ?> <h3 class="s-h3"><?php the_title(); ?></h3> <a class="s-a" href="<?php the_permalink(); ?>"><?php the_permalink(); ?> »</a><br><br> <?php endwhile;
It is working but at the moment every search result in other languages than German redirect me to the German search results page.
I use polylang with a German, French and Italian version. When I do a search in the German version everything works fine. But when I do a search in the French or Italian version, it always redirects to the German search results page with the message – no results found.
Do you have an idea on how I can fix that redirection bug? If not it´s totally fine. It could be some compatibility issue with the “Ivory Search” plugin.
ThanksApril 29, 2020 at 4:53 pm #1262102TomLead DeveloperLead Developer
Yea, that might be something you need to bring up with the search plugin. Sounds like there might need to be a tweak with the query so it respects the language.
Glad you figured out the template – did the default template not have the title linked to the post?April 29, 2020 at 11:39 pm #1262369Michael
I had to deactivate the Ivory Search plugin. Then it worked again.
No, the default template only had the_content without title and link to the page of the search result.
The settings in the layout > blog > archive didn’t work for me.
I will let you know later if I can replicate it on a test site so you know if it would be a small bug.April 30, 2020 at 9:19 am #1263463
- You must be logged in to reply to this topic.