How to change the text of the 'Return to top button'

Community Forums Forums Design Tips and Tricks How to change the text of the 'Return to top button'

This topic is: resolved

This topic contains 5 replies, has 2 voices, and was last updated by  braddalton 11 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #40469

    sebgates
    Participant
    Post count: 54

    This should be relatively simple. I may be missing something obvious. I want to change the text in the ‘Return to top of page’ button to ‘Back to top’. I have tried using simple edits, tried using the copy / paste code snippets from Studio Press. Nothing seems to be working. Can anyone help?

    Thanks – Seb

    #40472

    braddalton
    Participant
    Post count: 7443

    Add this code to the end of your child themes functions.php file. Modify the text to your liking.

    /** 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;
    }
    

    Source: http://my.studiopress.com/snippets/footer/


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

    #40483

    sebgates
    Participant
    Post count: 54

    Thanks Brad, I had tried the code snippet from the SP code snippet page. For some reason it does not seem to work on the site I am building. I will try it again on the next one. I can live with the default text for now.

     

    Thanks – Seb

    #40572

    sebgates
    Participant
    Post count: 54

    If anyone else has this problem in future, check your plugins. One of the plugins I was using stopped the code snippet from working. I created a new install and used the code and everything worked fine.

    #40573

    sebgates
    Participant
    Post count: 54

    it was the Simple Edits plugin from SP

    #40574

    braddalton
    Participant
    Post count: 7443

    Thanks for sharing that Seb.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

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

You must be logged in to reply to this topic.