• 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

creating back to top link in Frameworks

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 › Design Tips and Tricks › creating back to top link in Frameworks

This topic is: resolved

Tagged: backtotop

  • This topic has 9 replies, 3 voices, and was last updated 12 years, 5 months ago by Kitty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • January 20, 2014 at 1:45 pm #86138
    janburg
    Member

    The more I look at all the options for creating a link to the top for the footer in Frameworks the more confused I get as none of the options seem to work. I've tried the Simple Edits plugin, copied snippets of code and put it in the functions.php, and I'm not getting the link.

    Right now this is in my functions.php file in the child theme:
    //* Customize the entire footer
    remove_action( 'genesis_footer', 'genesis_do_footer' );
    add_action( 'genesis_footer', 'sp_custom_footer' );
    function sp_custom_footer() {
    ?>
    <p>© Copyright 2014 · Designs by Donna Atlanta · All Rights Reserved ·</p>
    <?php
    }
    What do I need to add to get the back to top link? I'm not real good at coding, so please be patient with me. Thanks!

    http://192.185.150.46/~designsb/
    January 20, 2014 at 4:12 pm #86174
    nutsandbolts
    Member

    Try this one instead:

    // Custom Footer
    add_filter('genesis_footer_output', 'footer_output_filter', 10, 3);
     
    function footer_output_filter( $output, $backtotop_text, $creds_text ) {
        $backtotop_text = '[footer_backtotop text="Return to Top of Page"]';
        $creds_text = 'Copyright [footer_copyright] <a href="http://designsbydonnaatlanta.com/" target="_blank" rel="nofollow">Designs by Donna Atlana</a> &middot All Rights Reserved';
        $output = '<div class="gototop">' . $backtotop_text . '</div>' . '<div class="creds">' . $creds_text . '</div>';
          return $output;
    }

    You may need to add some CSS to float "gototop" left and "creds" right, but that should get it working.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    January 20, 2014 at 4:25 pm #86180
    janburg
    Member

    Almost. The footer now reads:
    <div class="gototop">Return to Top of Page</div><div class="creds">Copyright © 2014 Designs by Donna Atlana &middot All Rights Reserved</div>

    And the link doesn't work, so I'm guessing there's an anchor saying where the top is? Just guessing...

    January 20, 2014 at 4:27 pm #86181
    nutsandbolts
    Member

    Did you copy from the notification email? If so, try copying directly from the post here on the forum, since the emails strip out the proper formatting.


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    January 20, 2014 at 4:33 pm #86182
    janburg
    Member

    Yes, that did it, thanks so much!

    January 20, 2014 at 4:34 pm #86183
    nutsandbolts
    Member

    Awesome! I'm going to mark this as resolved but feel free to open a new topic if needed. 🙂


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    January 20, 2014 at 4:34 pm #86184
    janburg
    Member

    oops, wrote too fast, the link still doesn't take me to the top?

    January 20, 2014 at 4:41 pm #86187
    nutsandbolts
    Member

    Okay, this has several steps, but stay with me.

    First, remove the function I gave you and replace it with this one:

    // Custom Footer
    add_filter('genesis_footer_output', 'footer_output_filter', 10, 3);
     
    function footer_output_filter( $output, $backtotop_text, $creds_text ) {
        $backtotop_text = '[custom_backtotop]';
        $creds_text = 'Copyright [footer_copyright] <a href="http://designsbydonnaatlanta.com/" target="_blank" rel="nofollow">Designs by Donna Atlana</a> &middot All Rights Reserved';
        $output = '<div class="gototop">' . $backtotop_text . '</div>' . '<div class="creds">' . $creds_text . '</div>';
          return $output;
    }

    Then add this function right above it to create the custom back to top shortcode I used above:

    //* Create a shortcode to display custom back to top link
    add_shortcode('custom_backtotop', 'set_footer_custombacktotop');
    function set_footer_custombacktotop($atts) {
    	return '
    		<a href="#" class="top">Return to top of page</a>
    	';
    }

    Then add this one to enable smooth scrolling (props to Sridhar Katakam for this):

    //* 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.top').click(function() {
                	$('html, body').animate({scrollTop:0}, 'slow');
    				return false;
            	});
            });
    	</script>
    <?php }

    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    January 20, 2014 at 4:59 pm #86191
    janburg
    Member

    Perfect!

    One of these days I need to learn php.

    Thanks for your help.

    January 24, 2014 at 6:29 am #86784
    Kitty
    Participant

    Is it possible that the back to top link created by Simple Edits refers to #wrap instead of .wrap?
    Should it not be updated to HTML5 this plugin?
    Just wondering...
    <div class="creds"> [footer_copyright first="2007"] W. Vos | [footer_backtotop]</div>

    searches http://www.keesomlaan.nl/eekhoorn/agio/#wrap ??

    Kitty

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Design Tips and Tricks’ 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