Updating Graphene theme: How not to loose the customizations of child theme?

  • sghegde87

    #8125

    Hi,

    I have Version 1.9.1 Installed and it is due to 1.9.2. I have graphene-child theme activated too.

    Usually I take the back up of some files which I have customized like footer.php, function.php and stylesheet.css etcc and replace the new ones after the update.

    This time, I have function, stylesheet css file in child theme… .

    Is there some way that I can update the main theme to 1.9.2 without having to backup and replace the files?? and without loosing the customizations??

    Also, wanted to know if footer.php file of main theme can be copied to graphene-child theme folder?(to customize) I tried it and the site went down!! is it not possible?

    Admin

    Syahir Hakim

    #40425

    If you’re already using a child theme, and you haven’t modified any of the original Graphene theme’s files, you can update the theme directly without needing to replace any files afterwards.

    sghegde87

    #40426

    @Syahir: Thanks for the reply…

    I have modified the footer.php file of original theme…. had to add link for my free hosting site…. .. How to preserve this after the update???

    Prasanna SP

    #40427

    You don’t have to edit footer.php to change credit links. You can change it using child theme as well. See this – http://www.prasannasp.net/how-to-change-translate-a-string-in-graphene-theme/

    sghegde87

    #40428

    @Prasannasp: Very good information. Will surely come in handy… But my scenario is that I have to add one more link along with WordPress and Graphene links…

    I want to add :Hosting provided by: ” Link to free hosting site”… This, I want to do it in footer next to wordpress and graphene… I have modified footer.php… However, just want to know how to keep this as it is after updating??

    Sorry for confusion.. Hope you got what I am trying to say…

    Prasanna SP

    #40429

    Yes, you can even add one more link using child theme without editing footer.php.

    First update the theme to version 1.9.2 and then add this to child theme functions.php.

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Powered by %1$s and the %2$s.' => 'Powered by %1$s and the %2$s. Hosting provided by <a href="http://vlexofree.com/">VlexoFree Hosting</a>'
    );
    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 );

    sghegde87

    #40430

    @Prasannasp: Excellent Piece of code!! Works perfectly.

    I had one small glitch before closing the tread…

    It kind of looks odd because of my CSS settings. I want to move the line starting with ‘Hosting provided by’ to next line… How to do this in this code..

    Can I use rn before the ‘Hosting’ sentence? Thought of trying myself but playing with php has messed up the site few times.. So I am leaving it to the experts…

    And one more thing, From next updates, I don’t have to change anything right??

    Prasanna SP

    #40431
    Quote:
    I want to move the line starting with ‘Hosting provided by’ to next line… How to do this in this code..

    'Powered by %1$s and the %2$s.' => 'Powered by %1$s and the %2$s.<br />Hosting provided by <a href="http://vlexofree.com/">VlexoFree Hosting</a>'

    Quote:
    And one more thing, From next updates, I don’t have to change anything right??

    Yes.

    sghegde87

    #40432

    @Prasannasp: Many many gratitude……. Thank you so much….. Gracious…

    Marking the thread as resolved..

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

You must be logged in to reply to this topic.