• I have built a site using the bones starter theme. The site is in two languages, so it has a header and footer template for each language. My only problem is that I have set the search form placeholder text and search results read more tags in the functions.php file, so the text is the same regardless of language.

    The menu is called like this:
    <?php get_search_form(); ?>

    In functions.php:

    // Search Form
    function bones_wpsearch($form) {
        $form = '<form role="search" method="get" id="searchform" action="' . home_url( '/' ) . '" >
        <label class="screen-reader-text" for="s">' . __('', 'bonestheme') . '</label>
        <input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="Search this site..." />
        <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
        </form>';
        return $form;

    More tag in functions.php:

    // Puts link in excerpts more tag
    function new_excerpt_more($more) {
           global $post;
    	return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read more...</a>';
    }

    Is there a way I can duplicate these, and call one depending on the language? Sorry for being confusing, I really hope you understand my question.

  • The topic ‘Change search form placeholder text and read more text’ is closed to new replies.