Support » Theme: Maskitto Light » Change the search field

  • Resolved maralhua

    (@maralhua)


    Hello,

    I was trying change the search field and put text in spanish keeping the theme style. I tried creating a new search_form file but nothing happens. I tried change the code inside header.php replacing <?php get_search_form(); ?> for:

    <form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
        <label>
            <span class="screen-reader-text"><?php echo _x( '', 'label' ) ?></span>
            <input type="search" class="top-search-field"
                placeholder="<?php echo esc_attr_x( 'Buscar...', 'placeholder' ) ?>"
                value="<?php echo get_search_query() ?>" name="s"
                title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
        </label>
        <input type="submit" class="search-submit"
            value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" />
    </form>

    then I change the text but I lose the previous style :/.

    I give it up, I need some help please u.u

    Thanks!

    • This topic was modified 1 year, 11 months ago by  maralhua.
    • This topic was modified 1 year, 11 months ago by  maralhua.
Viewing 1 replies (of 1 total)
  • Okkay,

    I found the solution replacing <?php get_search_form(); ?> for:

    <form role="search" method="get" action="<?php echo home_url( '/' ); ?>">
            <input class="top-search-field" name="s" value="" placeholder="Buscar..." type="text">
    </form> 

    ^^

Viewing 1 replies (of 1 total)
  • The topic ‘Change the search field’ is closed to new replies.