• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to translate the Search Results Page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Internationalization and Translations › How to translate the Search Results Page

This topic is: resolved

Tagged: string translation search box

  • This topic has 17 replies, 7 voices, and was last updated 5 years, 7 months ago by milada.
Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • December 31, 2015 at 6:36 am #175269
    tblogster
    Member

    Hello and Shalom,
    The site I'm building is in Hebrew. When I set it to Hebrew in the Settings>General, most of the default text on the front end changes to Hebrew like it should. (e.g. comments, meta tags).
    but the Title of the search results page stays in English "Search results for...:
    see here:
    http://giyur.org.il/?s=any+search
    How can I change this to Hebrew without editing the core Genesis files?
    I installed the Genesis translation plugin but it did nothing.
    A step by step guide would be so helpful.
    Thanks and Shalom
    Naomi

    http://giyur.org.il/?s=any+search
    December 31, 2015 at 6:39 am #175271
    Susan
    Moderator

    Use one of these code snippets: https://my.studiopress.com/snippets/search-form/

    December 31, 2015 at 6:43 am #175272
    tblogster
    Member

    Thanks for that @Susan.
    Those snippets work for the search form. I already did that translation.
    Now I need to translate the search results page. Specifically - the title of that page where it says "Search Results for:"
    AKA this
    http://giyur.org.il/?s=any+search

    Thanks
    Naomi

    December 31, 2015 at 11:02 am #175281
    baga
    Member

    I found this:

    remove_filter( 'wp_title', 'genesis_default_title', 10, 3 );
    
    add_filter( 'wp_title', 'genesis_default_title_new', 10, 3 );
    function genesis_default_title_new( $title) {
    
        $title = 'New title';
        return $title;
    }

    and it works but I would like to show the search terms as well after the 'New title'.
    How can we do?
    Thanks

    January 3, 2016 at 4:50 am #175437
    tblogster
    Member

    @baga I tried that code and it didn't have any impact for me. probably because the search page does not include a filter called "wp_title". at least it doesn't on my theme (cafe pro).
    So this question is still unanswered and I would really appreciate some help.
    Thank
    Naomi

    January 3, 2016 at 6:14 am #175438
    baga
    Member

    @naomi I solved the issue using the plugin Yoast SEO which allows to change the title for the search page as well as the 404 page (page not found title). Hope that helps.

    January 3, 2016 at 6:35 am #175439
    tblogster
    Member

    wow @baga that worked!
    i already had yoast installed so that was a super simple solution.
    Thanks a mil
    Naomi

    January 3, 2016 at 7:50 am #175440
    baga
    Member

    I'm glad I was able to help!

    January 4, 2016 at 4:20 am #175530
    Konceptuel
    Member

    Hi Naomi,
    when your site is in one language only, other than english, you can use a plugin like https://wordpress.org/plugins/loco-translate/ to translate text strings included in themes and plugins.

    September 18, 2016 at 8:55 am #193316
    HDDECOR
    Member

    great many thanks


    thiết kế thi công nội thất

    October 18, 2016 at 9:37 am #194968
    primsrungsuda
    Member

    This article is help me
    Thank you


    sextoy

    November 6, 2016 at 10:32 am #195789
    milada
    Member

    @baga I have the same problem, I have a blog in other languages and the Search box appears in English. I have pasted this code:
    //* Customize search form input box text
    add_filter( 'genesis_search_text', 'sp_search_text' );
    function sp_search_text( $text ) {
    return esc_attr( 'Search my blog...' );
    }
    to the functions.php file
    Can you please tell me in more detail how I should use Yoast seo to have it translated in other languages?

    Thank you very much in advance!

    Milada

    November 18, 2016 at 2:20 am #196310
    baga
    Member

    @milada

    you should go to Yoast Seo settings -> Titles and Metas -> Archives -> Special Pages -> Search Pages
    and put something like this:

    [:en]Search results for %%searchphrase%% %%sep%% %%sitename%%[:it]Risultati della ricerca per %%searchphrase%% %%sep%% %%sitename%%

    November 18, 2016 at 2:45 pm #196337
    milada
    Member

    @baga
    Hallo baga, thank you, I added this to the path Yoast Seo settings -> Titles and Metas -> Archives -> Special Pages -> Search Pages
    This: [:cz]Výsledky pro vyhledávání %%searchphrase%% %%sep%% %%sitename%%[:en]Search results for %%searchphrase%% %%sep%% %%sitename%%[:fr]Résultats de recherche pour %%searchphrase%% %%sep%% %%sitename%%[:it]Risultati della ricerca per %%searchphrase%% %%sep%% %%sitename%%[:de]Suchergebnisse für %%searchphrase%% %%sep%% %%sitename%%

    in one line. I am afraid there are no separate fields for individual languages. What am I doing wrong?

    Thank you in advance,

    Milada

    November 18, 2016 at 3:06 pm #196341
    baga
    Member

    What multilanguage plugin are you using?
    My suggestion was based on qTranslateX.

    November 19, 2016 at 4:06 am #196347
    milada
    Member

    @baga I see
    I use Polylang Pro

    November 19, 2016 at 4:08 am #196348
    baga
    Member

    Ok I do not know this plugin.
    Maybe you should ask the plugin author then.

    November 19, 2016 at 4:10 am #196349
    milada
    Member

    No problem. Thank you for your endeavour to help.

  • Author
    Posts
Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.
Log In

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2022 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble