Replacing 'Return to top of page' with an image

Community Forums Forums Design Tips and Tricks Replacing 'Return to top of page' with an image

This topic is: not resolved

This topic contains 13 replies, has 2 voices, and was last updated by  sebgates 1 year, 10 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #12829

    sebgates
    Participant
    Post count: 57

    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?

    #12920

    SoZo
    Moderator
    Post count: 1573

    You 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

    #12945

    sebgates
    Participant
    Post count: 57

    I 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.

     

     

    #12948

    SoZo
    Moderator
    Post count: 1573

    If 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

    #12952

    sebgates
    Participant
    Post count: 57

    Sorry 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

    #12964

    SoZo
    Moderator
    Post count: 1573

    The 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

    #12969

    sebgates
    Participant
    Post count: 57

    Thanks, 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.

    #12970

    SoZo
    Moderator
    Post count: 1573

    Post 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

    #12973

    sebgates
    Participant
    Post count: 57
    This reply has been marked as private.
    #12996

    SoZo
    Moderator
    Post count: 1573

    That Username/PW combo isn’t getting me in


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #12997

    sebgates
    Participant
    Post count: 57

    Sorry bro, I had not heard from you for a while and deleted it. I will set it up again with same details.

    #12998

    sebgates
    Participant
    Post count: 57
    This reply has been marked as private.
    #13000

    SoZo
    Moderator
    Post count: 1573

    One of your plugins is conflicting. Deactivated all of them and the change showed up.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13001

    sebgates
    Participant
    Post count: 57

    ok, no worries, thanks again

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

You must be logged in to reply to this topic.