You site now have the "Back to Top" link whenever you scroll down your page.

Now, what if you wish to put an image instead of Back to Top?

This too can be done easily. Just change the following code

echo '<a id="totop" href="#">Back to Top</a>';
to
echo '<img id="totop" alt="" src="Paste your image url here" />';

and you are done!


Hope you like this tutorial!




UPDATE: 30th November 2015, You can keep the code functioning even when updating your theme, the steps are similar but this time, you paste the codes inside the Child Theme of your Main Theme (Parent Theme). This way, you paste only one time and don't need to bother again, also, we don't need to worry about messing up coding in the Parent Theme.



Join the Discussion
Write something…
Recent messages
krazykat Premium
Great to know.
Thanks.
Reply
kiliwia62 Premium
What a great tutorial!!

I certainly will bookmark it and will try it out on one of my sites. Would be glad to get rid of one plugin, when it can be done the way you are showing.

Thank you
Sylvia
Reply
Harrysastar2 Premium
Thanks, bookmarked.
Reply
rosieM Premium
This is great! Trying it out son as I get in tonight!
Reply
PIOFJR Premium
Thanks for the great training! Sometimes it is so scary for me to do something about editing code. I might delete some important code and then don't know how to justify and putting it back. It needs a careful consideration for me to test this out. I bookmarked though.
Reply
TashiDeleh Premium
haha it certainly is not that scary as it seem, it is just adding additional code at the very end of editor and we wont be editing or deleting the original code.
Reply
Top