Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Problem with back-to-top button

  • Hello,
    My anchors don’t work properly with classic buttons in my pages.
    When I click on the back-to-top button, the page rises very slowly and is difficult to access.
    No problem if the internal anchor is in a navigation menu (but difficult to modify in css).
    I tried deactivating the smooth-scroll class in the theme customisation, but it didn’t work.
    Do you have a solution?
    Thanks

  • Hi there,

    It’s because you have this CSS is which interfering with the script of the back to top’s smooth scroll.

    html {
        scroll-behavior: smooth;
    }

    Try this PHP snippet to remove smooth scroll from the back to top button://remove GP smooth scroll from back to top button:

    add_filter( 'generate_back_to_top_js_args', function( $args ) {
        $args['smooth'] = false;
    
        return $args;
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

  • It’s perfect.
    Thank you for your support, which is always responsive and provides the right solution! 😉

  • You are welcome   🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.