Change Powered by WordPress and the Graphene Theme
-
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 🙁
Mod
Help us to help you by explaining:
- What behavior you were expecting
- What behavior you actually got
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.
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 );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.
