[Resolved] Back to Top on one page only

Home Forums Support Back to Top on one page only

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1481051
    Ramona

    I am using GP and GPP. Prior to the Update to GP version 3.0.1, I was able to successfully run the following in my functions.php of my Child Theme in order to have Back To Top functionality on one page only. In the Customizer > Layout > Footer, Back To Top Button was Disabled. What has changed?

    Code:
    function ramona_add_back_to_top($options ) {
    if ( is_page( ‘gallery’ ) ) {
    $options[‘back_to_top’] = ‘enable’;
    }

    return $options;
    }

    add_filter( ‘option_generate_settings’,’ramona_add_back_to_top’ );

    #1481116
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    GP 3.0 only loads the back to top CSS if it’s enabled globally.

    You could try doing something like this:

    1. Enable the option globally.
    2. Disable it everywhere but the page:

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

    Let me know πŸ™‚

    #1481194
    Ramona

    Hi Tom,

    Thank You SO MUCH! It worked like a charm. Thank You for all of your hard work. It’s much appreciated!

    #1482274
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad I could help! πŸ™‚

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