Return to Support

Change Powered by WordPress and the Graphene Theme

Home Forums Graphene WordPress theme Support Change Powered by WordPress and the Graphene Theme

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8496
    luka1002
    Member
    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 );

    This does not work 🙁

    #41308

    Help us to help you by explaining:

    • What behavior you were expecting
    • What behavior you actually got

    #41309
    luka1002
    Member

    Well, i wonna remove everything from footer and place my one text. Have to do it in child theme. Tried this code up, and does not work. When loading functions.php (from child) first loads text of code and than normal blog like no change. I removed this functions.php for now.

    http://electronicequip.net/

    #41310
    Prasanna SP
    Member

    It is a PHP code. You need to put that code after the opening PHP tag, i.e <?php.

    Try this,

    <?php
    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 );

    #41311
    luka1002
    Member
    Quote:
    It is a PHP code. You need to put that code after the opening PHP tag, i.e <?php.

    Try this,

    <?php

    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 );

    This is better, removed all but my text is not there?

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

You must be logged in to reply to this topic.