[Resolved] back to top button

Home Forums Support [Resolved] back to top button

Home Forums Support back to top button

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #170348
    ian

    the back to top button in my opinion

    turns on too late when scrolling down and turns off too early when scrolling up

    see on dev site here

    it is shown next to “Smooth Page Scroll to Top” plugin

    Minor point but thought I would point it out

    Also is it possible to change the icon used for this ?

    Ian

    • This topic was modified 8 years, 2 months ago by ian.
    • This topic was modified 8 years, 2 months ago by ian.
    #170433
    Tony

    I agree that the plugin comes on a fraction earlier then the built-in one but maybe too soon, before you need to go ‘top’?
    Overall it seems to work ok on Chrome – for me anyway.

    #170502
    Tom
    Lead Developer
    Lead Developer

    I included some filters in this feature so these values can be adjusted: https://generatepress.com/knowledgebase/filter-list/

    generate_back_to_top_scroll_speed
    Default: 400

    generate_back_to_top_start_scroll
    Default: 300

    For example:

    add_filter( 'generate_back_to_top_start_scroll', 'generate_back_to_top_start_scroll' );
    function generate_back_to_top_start_scroll()
    { 
        return 100;
    }

    Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

    Let me know if you need more info ๐Ÿ™‚

    #170618
    ian

    thanks very much

    never tried adding my own php before but it all went very well
    works perfectly now

    thanks for your help/advice

    you didn’t say if it is possible
    to change the icon used for this ?

    Ian

    #170627
    ian

    Just found this flter
    generate_back_to_top_icon

    so forget above question

    Ian

    #170633
    ian

    can’t get change back_to_top_icon filter to work
    this is the code I am trying
    generate_back_to_top_start_scroll works
    generate_back_to_top_icon doesn’t

    add_filter( ‘generate_back_to_top_start_scroll’, ‘generate_back_to_top_start_scroll’, ‘generate_back_to_top_icon’);
    function generate_back_to_top_start_scroll()
    {
    /* make back to top appear sooner when down, later when up */
    return 100;
    }

    function generate_back_to_top_icon()
    {
    /* change icon */
    return ‘fa-hand-o-up’;
    }

    any idea what I am doing wrong

    Ian

    #170660
    Tom
    Lead Developer
    Lead Developer

    Hi Ian,

    You’re forgetting the add_filter call:

    add_filter( 'generate_back_to_top_icon','generate_back_to_top_icon' );
    function generate_back_to_top_icon()
    {
        return 'fa-hand-o-up';
    }
    • This reply was modified 8 years, 2 months ago by Tom.
    #170682
    ian

    Hi Tom

    Thanks for that it works ๐Ÿ™‚

    Ian

    • This reply was modified 8 years, 2 months ago by Tom.
    • This reply was modified 8 years, 2 months ago by Tom.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.