Search and results

Hi, I’d like to change the language of the search bar because when I click on it i get the english text that says “type and press enter to search”. I also would like to change the language of the page results that says “Search results, below u’ll see everything we coud locate for…etc”. I also would like to know why the results page have always the articles on the side? I’d like to change the layout in order to have only the results and not the articles on the right. thank you

Hi @fra666,

Thank you for reaching out to us. For the site translations, please follow our guide here https://theme.co/apex/forum/t/setup-translation/61

Alternatively You can also translate words and small strings via WordPress filters. For example to translate text on your search results page, you can paste the following code in your child theme’s functions.php file:

add_filter( 'gettext', 'translate_x_strings', 20, 3 );

function translate_x_strings( $translated_text, $text, $domain ) {

        switch ( $translated_text ) {
			
            case "Search Results" :

                $translated_text = __( 'Your translated text', '__x__' );
                break;
				
			case "Below you'll see everything we could locate for your search of " :

                $translated_text = __( 'Another translated text ', '__x__' );
                break;

        }

    return $translated_text;
}

In this method, the original string should match the exact string you wish to translate. Any space or mismatched characters will invalidate the translation.

To remove the sidebar from the search results page, add the following code in the Theme Options > CSS:

.search .x-main {
    width: 100%;
}
.search .x-sidebar {
    display: none;
}

Don’t forget to clear all caches including your browser’s cache after adding the code. Let us know how this goes!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.