• Resolved bob

    (@dannyotoole)


    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.

Viewing 1 replies (of 1 total)
  • Hello,

    ?The way the plugin is designed is by using individual strings, making it quite intuitive not having to create a separate page for each translated page.

    As pages are dynamically created they are not found in “pages – all pages / posts – all posts / product – all products / etc.”

    This mean that by default you cannot see the page/post/product in the second language (search bar) until someone (you or a user) enter especially on the page/posting/translated product.
    After someone accesses the product; that product will appear in the search bar

    Kind regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Search Results Page for other Languages Issue’ is closed to new replies.