Return to Support

How to update Child Theme?

Home Forums Graphene WordPress theme Support How to update Child Theme?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #8494
    paulrugz
    Member

    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….

    #41291
    Prasanna SP
    Member

    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.

    #41292
    paulrugz
    Member

    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…

    #41293
    Prasanna SP
    Member

    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.

    #41294
    paulrugz
    Member

    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…

    #41295
    Prasanna SP
    Member

    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.

    #41296
    paulrugz
    Member

    Hi…Prasanna.

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

    FnPHP03.png

    #41297
    Prasanna SP
    Member

    You need to activate the child theme!

    #41298
    paulrugz
    Member

    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….

    #41299
    Prasanna SP
    Member

    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.

    #41300
    paulrugz
    Member

    Oh.. i see…

    Thank you so much Prananna..

    It works now 🙂

    You may see my work result here BPKConcrete.com

    Thank you again

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

You must be logged in to reply to this topic.