How to give Theme credit in footer
-
Hello,
My site is http://www.shortstoryguy.com.
Currently I have:
#developer {
display: none;
}In my child theme CSS to not display the default “Powered by WordPress and the Graphene Theme” (which comes with two links).
I want to give credit to Graphene for all the great help it has given me, but I want to only have it say:
“Graphene Theme” with the link. Not the powered by WP and the….
I didn’t know how to do that so that’s why I currently have that #developer display none in css.
Please help.
Thank you,
Jose
Admin
Insert this into your child theme’s
functions.phpfile:function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Powered by %1$s and the %2$s.' => '%2$s',
);
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 );Thank you Syahir. Pleased to meet you….Thanks for your theme.
Q: currently I only have a style sheet in my child theme…
If I follow your advice above, is it OK if this is the ONLY thing in my functions.php child theme? Or do I need other code in that form?
Thank you,
Jose
Yes, create a
function.phpfile in your child theme and add the above function after opening PHP tag, i.e<?phpThank you.
I needed to add this function and another from post:
https://forum.graphene-theme.com/graphene-support/how-to-change-search-box-text#post-35715
Putting both function codes broke my site so I went ahead and fooled around and did this:
<?php
function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Search' => 'Search Short Story Guy', 'Powered by %1$s and the %2$s.' => '%2$s',
);
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 );
?>Now the two things I wanted to achieve are done. Is this going to be OK to leave like this?
Thank you.
Yup, that’s the correct syntax to translate two or more strings.
Put code in between backtick (
Code:`) characters. It’s usually located above the Tab key on your keyboard.
ok. thanks.
I used Jose’s code to customize my search box and also to change the footer to the extent that it now just says Graphene them. Can you tell me how to make more changes to the footer, such as adding another company name with a link?
The site is at marlissmelton.com/dev
I understand CSS and some html, but I don’t really understand the php function code, not even what I’ve just cut and pasted to the child theme.
Thanks,
Sydney
Perhaps I have figured it out by using the Action Hooks. Thanks.
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
