Translate search form
-
Hello!
I use Polylang and have made a searchform.php in my Zerif Lite Child theme. I would like to translate the terms “Search for:” and “Search on our website”, so that is dependent on the chosen language. How can I do it?
`<?php
/**
* default search form
*/
?>
<form role=”search” method=”get” id=”search-form” action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>”>
<div class=”search-wrap”>
<label class=”screen-reader-text” for=”s”> <?php _e( ‘Search for:’, ‘zerif-lite-child’ ); ?></label>
}
<input type=”search” placeholder=”<?php echo esc_attr( ‘Search on our website’, ‘zerif-lite-child’ ); ?>” name=”s” id=”search-input” value=”<?php echo esc_attr( get_search_query() ); ?>” />
<input class=”screen-reader-text” type=”submit” id=”search-submit” value=”Search” />
<input type=”submit” class=”search-submit” value=”S?k”>
</div>
</form>`
- The topic ‘Translate search form’ is closed to new replies.