• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to add "Back to Top" to footer

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How to add "Back to Top" to footer

This topic is: not resolved

Tagged: Back to Top Option in Footer

  • This topic has 1 reply, 2 voices, and was last updated 7 years ago by Victor Font.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 2, 2019 at 3:37 pm #492756
    selhost
    Participant

    Hi! I'm using the Education Pro theme and wonder if it's possible to add a "back to top" link in the footer without neeeding to add a plugin? I see the Genesis Simple Edits has the "backtotop" text, but it doesn't work in the footer (as seen in the site link below). I would appreciate any help you guys can give me. Thank you!

    http://hlrsc.net
    August 2, 2019 at 5:00 pm #492757
    Victor Font
    Moderator

    This is the code I use on my sites for back to top.

    add_shortcode('footer_custombacktotop', 'set_footer_custombacktotop');
    function set_footer_custombacktotop($atts) {
    	return '<a title="Return to top of page" class="button gototop" href="#" aria-label="Return to top of page"><i class="far fa-arrow-alt-circle-up"><span class="screen-reader-text">Return to top of page</span></i></a>';
    }
    
    //* Add smooth scrolling for any link having the class of "top"
    add_action('wp_footer', 'go_to_top');
    
    function go_to_top() { ?>
    	<script type="text/javascript">
    		jQuery(function($) {
    			$('a.button.gototop').click(function() {
    				$('html, body').animate({scrollTop:0}, 'slow');
    			return false;
    			});
    		});
    	</script>
    <?php }

    This code can be added to functions.php. The shortcode is [footer_custombacktotop]. I also use a Fontawesome Up Arrow icon in place of text to indicate back to top. If you don't use Fontawesome, you'll need to change this code to something else that works for your site:

    <i class="far fa-arrow-alt-circle-up"><span class="screen-reader-text">Return to top of page</span></i>


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble