"Scroll to top" of page

  • Anonymous


    Its sometimes slowly to “Scroll to top” of page in Graphene. (Read WP 🙂

    You can use footer.php to place a link eg. in <div id=”developer”>:

    <div id="developer">
    <a href="#">=Scroll to top=</a>
    <?php /* translators: %1$s is the blog title, %2$s is the theme's name, %3$s is the theme's author */ ?>
    <?php printf(__('%1$s uses %2$s theme by %3$s.', 'graphene'), '<a href="' . get_home_url() . '">' . get_bloginfo('name') . '</a>', '<a href="http://www.khairul-syahir.com/wordpress-dev/graphene-theme">' . ucfirst(get_template()) . '</a>', 'Syahir Khairul'); ?></p>

    <?php do_action('graphene_developer'); ?>



    Syahir Hakim


    Better implementation using a child theme:

    Child theme’s functions.php file:

    function graphene_scroll_to_top(){ ?>
    <p id="scroll-to-top"><a href="#">=Scroll to top=</a></p>
    add_action('graphene_developer', 'graphene_scroll_to_top');

    And then style the link in CSS.

    This way, you won’t have to override the entire footer.php file, which is not recommended cause I may add new codes to the theme’s footer.php file in the future.



    Yes its better in functions.php.

    Thnx for the code.


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

  • You must be logged in to reply to this topic.