• Resolved Res2

    (@res2)


    Hi

    Nobita has written a small php script for me, allowing me to rename my searchfield and -button.

    gestaltudvikling.dk

    Unfortunately, the name of the searchbutton does not appear on the searchbutton
    (The word is in the php script, but does not appear on the button)

    The word that should be on the button is

    S?g

    (native word for Search)

    Anyone knows php?
    The code looks like this:

    <?php
    /**
     * Template for search form.
     *
     *
     * @package Raindrops
     * @since Raindrops 0.1
     */
    if ( !defined( 'ABSPATH' ) ) {
        exit;
    }
    global $raindrops_document_type, $template;
    do_action( 'raindrops_pre_part_' . basename( __FILE__, '.php' ) . '_' . basename( $template ) );
    
        ?>
        <form method="get" name="searchform" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" <?php raindrops_doctype_elements( '', 'role="search"' ); ?>>
            <div class="searchform">
                <label class="screen-reader-text" for="s">Emne:</label>
                <input type="text" value="<?php the_search_query(); ?>" pattern="^[^(<|>)]+$" title="<?php esc_attr_e( 'must not contain html tags', 'Raindrops' ); ?>" placeholder="<?php esc_attr_e( 'Emne', 'Raindrops' ); ?>" name="s" id="s"  />
                ?<input type="submit" id="searchsubmit" value="<?php esc_attr_e( 'S?g', 'Raindrops' ); ?>" />
            </div>
        </form>
        <?php
    
    do_action( 'raindrops_after_part_' . basename( __FILE__, '.php' ) . '_' . basename( $template ) );
    ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • it looks like some kind of theme variable is in there. you could probably replace it with just the word.

    <?php
    /**
     * Template for search form.
     *
     *
     * @package Raindrops
     * @since Raindrops 0.1
     */
    if ( !defined( 'ABSPATH' ) ) {
        exit;
    }
    global $raindrops_document_type, $template;
    do_action( 'raindrops_pre_part_' . basename( __FILE__, '.php' ) . '_' . basename( $template ) );
    
        ?>
        <form method="get" name="searchform" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" <?php raindrops_doctype_elements( '', 'role="search"' ); ?>>
            <div class="searchform">
                <label class="screen-reader-text" for="s">Emne:</label>
                <input type="text" value="<?php the_search_query(); ?>" pattern="^[^(<|>)]+$" title="<?php esc_attr_e( 'must not contain html tags', 'Raindrops' ); ?>" placeholder="Emne" name="s" id="s"  />
                 <input type="submit" id="searchsubmit" value="S?g" />
            </div>
        </form>
        <?php
    
    do_action( 'raindrops_after_part_' . basename( __FILE__, '.php' ) . '_' . basename( $template ) );
    ?>
    Theme Author nobita

    (@nobita)

    @mr Case
    thank you for nice support

    @res2
    Please try Mr Case plan.

    Thank you

    Thread Starter Res2

    (@res2)

    Thanks for the effort.
    Regrettably, it doesn’t quite work…

    Clipping out <?php esc_attr_e( 'Emne/S?g', 'Raindrops' ); ?> and replacing them with just Emne/S?g does put the words there. But apparently, the php-code cannot reproduce/recognize the danish letter ‘?’ (or ? or ?, I guess) and the word is also not in the middle of the button… :-/

    Please take a look
    Gestaltudvikling.dk

    Theme Author nobita

    (@nobita)

    Please check

    Did you save in UTF-8 when you save the file (not bom) ?

    If, if you are saved in UTF-8(not bom), by performing the specified font, I think that it will be able to successfully display.

    <input type="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'raindrops' ); ?>" style="font-family:sans-serif" />

    sans-serif or popular font for your language.

    Thread Starter Res2

    (@res2)

    Ahhh, ok! ??
    UTF-8
    That made it work.

    Many thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search Button’ is closed to new replies.