[Resolved] Enable Back to top button on 1 page

Home Forums Support [Resolved] Enable Back to top button on 1 page

Home Forums Support Enable Back to top button on 1 page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #962539
    leekapa

    Hi,

    Can you please help me enable the back to top button to show on one page only, which will be my homepage.

    Thanks

    #962617
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this function:

    add_filter( 'option_generate_settings', function( $options ) {
        if ( ! is_front_page() ) {
            $options['back_to_top'] = '';
        }
        
        return $options;
    } );

    Let me know πŸ™‚

    #963228
    leekapa

    You Legend. Thanks heaps!

    #963492
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #1062419
    leekapa

    Hey Tom,

    I only just noticed that this code stopped working on my front page which is still set as the same. I’m guessing that it stopped when gp updated.

    Any thoughts?

    Thanks,
    Lee

    #1062482
    Leo
    Staff
    Customer Support

    Hmm the code should still work.

    Can you link us to the page in question?

    #1065864
    leekapa

    https://mindless.life

    I also deactivated all plugins and still no luck. Plus I use a child theme, so the code wasn’t overwritten.

    Thanks

    #1065878
    Leo
    Staff
    Customer Support

    Just to make sure, the option in the customizer is turned on here?
    https://docs.generatepress.com/article/back-to-top-button/

    If so can you disable Autopimize for now?

    Thanks πŸ™‚

    #1065900
    leekapa

    Sorry, I should have also checked that. It was disabled, but I don’t know why. In future, that’ll be the first thing I check.

    Thanks again.

    #1065901
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

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