How do I change Powered by WordPress and the Graphene Theme. in the footer

  • lenw

    #5539

    I want to change the footer text “Powered by WordPress and the Graphene Theme.”, not delete it, hide it or remove the div block – just change the actual text.

    The only solution so far that appears to allow this is to create a child theme, add the footer.php template file that I have changed.

    I have tried action footer.php action hooks, but none of them hook into this section.

    Is there any other way to acheive this, so that the footer.php is included wiht future theme updates?

    Thanks

    LenW

    Mod

    Kenneth John Odle

    #32166

    Moved to Support.

    You can use this css to hide it:

    #developer {display:none;}

    and then add an action hook widget area to add whatever text you would like.

    This question has actually been answered previously (more than once, iirc), so if you don’t like my solution (which I admit is inelegant and clumsy), search around for it. I believe it involves a child theme and a filter in the functions file.

    lenw

    #32167

    Thanks for your suggestion, and yes I have seen this before. Its not a solution I like, as you say its messy. I want to know how I can change the text in the footer.php, not hide it. I have tried the action hoot widget approach and got separate text in there, but the original remains, even if hidden.

    Maybe I just go with the child theme and a new footer.php, but that sort of defeats the object of a theme taking updates. Is there any alternative approach, or is this better as a suggested enhancement to the theme?

    Thanks

    Admin

    Syahir Hakim

    #32168

    Throw this code into your child theme’s functions.php file:

    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Powered by %1$s and the %2$s.' => 'This site does not have Super Cow power!',
    );
    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 );

    Obviously, change the text This site does not have Super Cow power! to whatever text you want to put there.

    lenw

    #32169

    Thanks, this works fine.

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

You must be logged in to reply to this topic.