Change text from button 'Read more' into our

  • Maciej

    #7485

    Is it possible to change text on the button ‘Read More’ under long posts into other, for example just ‘More’ ?

    Maciej

    #38397

    Thanks, but still can’t get through it. I have made file ‘functions.php’ im my child-theme folder, put this whole code from your link there (of course with opening and closing php tags), changed texts which i want to change, but nothin happens.

    Prasanna SP

    #38398

    Can you post the code you have in functions.php here?

    Maciej

    #38399

    as you wish

    (that file functions.php i’ve made from scratch, so only text there is that under)

    <?php

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Pozostaw komentarz' => 'Komentarz',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    ?>

    Prasanna SP

    #38400

    Try,

    <?php
    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Read more' => 'Komentarz',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    ?>

    Prasanna SP

    #38401

    Hmm, isn’t that “Leave a comment”??

    Maciej

    #38402

    Yep, certainly, but it’s not the most important. I have polish version so ‘Leave a comment’ goes to ‘Pozostaw komentarz’

    and all i want is to change that ‘Pozostaw komentarz’ into Skomentuj’.

    Unfortunatelly, your code from above still doesn’t change anything on my site ;/.

    Prasanna SP

    #38403

    In that case, try this.

    <?php
    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Leave comment' => 'Skomentuj',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );

    ?>

    Maciej

    #38404

    its’ working now.

    Great. Big thanks for help !

Viewing 10 posts - 1 through 10 (of 20 total)

You must be logged in to reply to this topic.