• 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

Adding a sticky ‘Back to top’ using jQuery impossible with Prose?

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 › Adding a sticky ‘Back to top’ using jQuery impossible with Prose?

This topic is: not resolved

Tagged: Back to top, custom php, jquery, Prose theme

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 11 months ago by Ozzy.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 3, 2013 at 9:41 pm #32994
    Steve
    Member

    Hi everyone,

    I’ve spent days using the Prose child theme and I find interesting the way we can customize it through custom.css and custom.php files.

    I'm searching a way to integrate a sticky ‘Back to top’ with a smooth auto-scroll effect. A plugin isn't necessary and I don't want to use one for that little thing. There is a light and efficient solution in this link: http://agyuku.net/2009/05/back-to-top-link-using-jquery/

    I'm trying to reproduce it but it doesn't work with Prose theme and I can't figure it out.

    This simple html line "<div id="toTop">Back to Top</div>" seems to be hard to include!

    In custom.php I tried with "echo “<div>”;" and "<?php echo “<div>”; ?>" but nothing happens. I thought it should work using "echo" as for any php file but maybe I'm missing something with Genesis?

    And adding the "<div id="toTop">Back to Top</div>" code directly in a text widget doesn't work too.

    Maybe somebody can explain me how we can create the div with Prose?

    Any help would be appreciated.

    April 7, 2013 at 9:46 pm #33870
    Ozzy
    Member

    You could try adding this:

    add_action( 'genesis_after', 'custom_backtotop_button', 1);
    
    	function custom_backtotop_button() {
    
    		echo '<div id="toTop">';
    
    			echo '^ Back to Top';
    
    		echo '</div>';
    
    	}

    to the custom.php and it should add the div onto the page


    Ozzy Rodriguez | Twitter | Google+

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 2023 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