Search Results Page for other Languages Issue
-
Hi all,
So I have a problem with my search results page and using the standard WordPress search bar. When i search in the English version of my site it will display the correct results, but if i go onto the Italian version of the site and search an Italian word it will bring me to a results page with a mixture of English and Italian results, with results not really to do with my search phrase.
So I have english and italian categories for different posts, which helps display different text/ posts or whatever on different parts of the site.
What could be some sort of a work-around is to make a custom search.php file, within it use this php code on translatePress’s site:
<?php $current_language = get_locale(); if( $current_language == 'en_EN' ){ //filter search results (pages/ post) from english categories } if( $current_language == 'it_IT' ){ //filter search results (pages/ post) from italian categories } ?>
I’m not even sure if this would work or how exactly to go about it, but another drawback of this is i’d have to add any new categories manually into the same custom file in the future, which is not a good solution.
I also want to use an ajax search bar plugin, either ivory search bar or ajax search lite, make two different search bars for the langauges and their categories and filter them on the page using translatePress shortcodes.
But again it’s the same issue of the search results page, and i’m kinda unsure what to do.
Anyone else having issues like this?
Thanks for reading this extremely long post.
- The topic ‘Search Results Page for other Languages Issue’ is closed to new replies.