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

Community Forums Forums Design Tips and Tricks Adding a sticky ‘Back to top’ using jQuery impossible with Prose?

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Ozzy 1 year, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32994

    Steve
    Participant

    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.

    #33870

    Ozzy
    Participant
    Post count: 211

    You could try adding this:

    [php]add_action( ‘genesis_after’, ‘custom_backtotop_button’, 1);

    function custom_backtotop_button() {

    echo ‘<div id="toTop">’;

    echo ‘^ Back to Top’;

    echo ‘</div>’;

    }[/php]

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


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

You must be logged in to reply to this topic.