Community Forums › Forums › Archived Forums › Design Tips and Tricks › Replacing 'Return to top of page' with an image
Tagged: return to top of page
- This topic has 13 replies, 2 voices, and was last updated 11 years, 3 months ago by sebgates.
-
AuthorPosts
-
January 18, 2013 at 7:18 am #12829sebgatesMember
Has anyone used anything other than text to allow visitors to go back to the top of the page by pressing the text in the footer? I would like to use an image with text. Can anyone help?
January 18, 2013 at 2:11 pm #12920SoZoMemberYou could set an image as the background and then indent the text so it's hidden or follow this to edit the function.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 18, 2013 at 3:36 pm #12945sebgatesMemberI added the following code to the bottom of the functions php file:
/** Customize the return to top of page text */
add_filter(
'genesis_footer_backtotop_text'
,
'custom_footer_backtotop_text'
);
function
custom_footer_backtotop_text(
$backtotop
) {
$backtotop
=
'[footer_backtotop text="Return to Top"]'
;
return
$backtotop
;
}
Nothing happened: http://report.xl-websites.com/
I did the same with the code snippet that changes 'Speak you mind' and it worked.
It is not a big problem, but I would like to be able to add an icon of an arrow pointing up if possible. I am no expert in PHP but happy to give something a go if you have an easy solutions.
January 18, 2013 at 3:40 pm #12948SoZoMemberIf what you added is exactly what you just posted then you didn't edit anything since it still just outputs "Return to top". Replace the shortcode with an image tag or add your image as the background of the div.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 18, 2013 at 3:46 pm #12952sebgatesMemberSorry bro, I am a novice at PHP and only 2 weeks in to Genesis. I changed the text to 'Back to top' (3rd line at the end of the line) and nothing happened.
Out of the following code, what do I change to make the text different?
add_filter(
'genesis_footer_backtotop_text'
,
'custom_footer_backtotop_text'
);
function
custom_footer_backtotop_text(
$backtotop
) {
$backtotop
=
'[footer_backtotop text="Return to Top"]'
;
return
$backtotop
;
And where would I add the background image, to the css rule or to this php code?Thanks for your patients
January 18, 2013 at 4:05 pm #12964SoZoMemberThe shortcode is '[footer_backtotop text="Return to Top"] The text returned is "Return to Top". And all style rules should be added to the style sheet, style.css. You can use Firebug to determine the rule to edit but it's .gototop
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 18, 2013 at 4:12 pm #12969sebgatesMemberThanks, it still does not change the linking text in the footer 🙁 This is my first attempt at building a theme using Genesis and I have made loads of errors getting to know my way around. I may have hacked something without knowing what I was doing. I will implement the short code first thing on the next design. Thanks for your time.
January 18, 2013 at 4:16 pm #12970SoZoMemberPost the contents of your functions.php so I can see what else is in there. And what is the URL?
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 18, 2013 at 4:24 pm #12973sebgatesMemberThis reply has been marked as private.January 18, 2013 at 5:54 pm #12996SoZoMemberThat Username/PW combo isn't getting me in
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 18, 2013 at 5:54 pm #12997sebgatesMemberSorry bro, I had not heard from you for a while and deleted it. I will set it up again with same details.
January 18, 2013 at 5:58 pm #12998sebgatesMemberThis reply has been marked as private.January 18, 2013 at 6:02 pm #13000SoZoMemberOne of your plugins is conflicting. Deactivated all of them and the change showed up.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 18, 2013 at 6:03 pm #13001sebgatesMemberok, no worries, thanks again
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.