This topic contains 4 replies, has 3 voices, and was last updated by  mrjoshfisher 2 months, 2 weeks ago.

Changing the search box text

  • Hello,

    im having an issue trying to change the search box text to PT when on the PT site, there are no options in the theme settings to set this, so Ive had to make a child theme and alter the searchform.php file myself.

    But it still isnt working but the same code is working elsewhere on the site.

    
    <form role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
        <div>
    	    <?php if(get_locale() === 'pt_PT'){ ?>
    		<input type="text" class="search-input" placeholder="<?php esc_html_e('pesquisa e enter.', 'soledad'); ?>" name="s" id="s" />
    		<?php } else { ?>
    		<input type="text" class="search-input" placeholder="<?php esc_html_e('Type and hit enter...', 'soledad'); ?>" name="s" id="s" />
    		<?php } ?>
    	 </div>
    </form>
    

    Any ideas would be greatly appreciated.

    Im aware that this theme supports multi languages via wpml but dont really want to signup to a subscription service for a plugin when polylang is free and does just aswell.

    • This topic was modified 2 months, 2 weeks ago by  mrjoshfisher.

    Hi,

    Please try with this code:

    <form role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
        <div>
    	    <?php 
    $current_lang = get_bloginfo('language');
    if($current_lang == 'pt-PT'){ ?>
    		<input type="text" class="search-input" placeholder="<?php esc_html_e('pesquisa e enter.', 'soledad'); ?>" name="s" id="s" />
    		<?php } else { ?>
    		<input type="text" class="search-input" placeholder="<?php esc_html_e('Type and hit enter...', 'soledad'); ?>" name="s" id="s" />
    		<?php } ?>
    	 </div>
    </form>

    Hope this help.

    Best Regards,
    PenciDesign

    Hello,

    No its still the same text :/

    PT Version – https://www.dropbox.com/s/lr8l1mxwtoidccm/Screenshot%202017-01-13%2017.14.24.png?dl=0

    English Version – https://www.dropbox.com/s/l60l9vpkskj038t/Screenshot%202017-01-13%2017.14.43.png?dl=0

    Is this the only location where the search form is ? or is it elsewhere in the theme ?

    Cheers

    Josh

    Hi,

    Please send us an email via our contact form with your admin url and admin account. Our support team will check it help you.

    Best Regards,
    PenciDesign

    Cheers sent it.

You must be logged in to reply to this topic.