How to update Child Theme?

  • paulrugz

    #8494

    Dear Sir,

    I’m quite new to wordpress, php and html. please advise how to update child theme as i need to place the coding below.

    My objective is to update the “Text” in “more tag”….

    Please advise step by step….

    // Change "Read the rest of this entry" link Button
    function graphene_filter_readmore( $translated, $original, $domain ) {
    $strings = array(
    'Continue reading »' => 'My New Text »',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_readmore', 10, 3 );

    Thank you….

    Prasanna SP

    #41291

    Create a new file named functions.php in child theme and add the above code after the opening php tag, i.e <?php. So your child-theme functions.php should look like this,

    <?php
    // Change "Read the rest of this entry" link Button
    function graphene_filter_readmore( $translated, $original, $domain ) {
    $strings = array(
    'Continue reading »' => 'My New Text »',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_readmore', 10, 3 );

    Put code in between backtick (

    Code:
    `

    ) characters here in this forum. It’s usually located above the Tab key on your keyboard.

    paulrugz

    #41292

    Dear Prasanna,

    I’ve already create file function.php, style.css as below but my custom text in “More tag” still now show.

    please advise

    StyleCSS.png

    FnPHP.png

    Thank you…

    Prasanna SP

    #41293

    Try this,

    <?php
    // Change "Read the rest of this entry" link Button
    function graphene_filter_readmore( $translated, $original, $domain ) {
    $strings = array(
    'Continue reading &raquo;' => 'My New Text »',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_readmore', 10, 3 );

    Only change My New Text » in the above code.

    paulrugz

    #41294

    Dear Prasanna,

    I’ve already try using your code as below but it still doesn’t change the “more tag” . (you may see result @bpkconcrete.com)

    FnPHP02.png

    I’m not sure are there any other step to do after create child theme folder, create style.css and function.php ?

    Please advise…

    Prasanna SP

    #41295

    Do you want to translate Continue reading » or Read the rest of this entry »? Because I see Read the rest of this entry » on your homepage. If that’s the case, change

    'Continue reading &raquo;' => 'My New Text »',

    to

    'Read the rest of this entry &raquo;' => 'My New Text »', in the array.

    paulrugz

    #41296

    Hi…Prasanna.

    I’ve place the new code as below but it still doesn’t work….

    FnPHP03.png

    Prasanna SP

    #41297

    You need to activate the child theme!

    paulrugz

    #41298

    Hi Pransanna,

    the Text in more tag are changed now, BUT the theme design, Header, etc was totally change.

    I need to use the same as the previous one with the current “More tag” what should I do Y_Y???

    Please help….

    Prasanna SP

    #41299

    WordPress treats the child theme as an entirely different theme. So, when you activate it, the header, background image, custom menus all revert back to defaults. Just go to respective sections and re-assign them.

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

You must be logged in to reply to this topic.