[Resolved] Back to top button for one page only

Home Forums Support [Resolved] Back to top button for one page only

Home Forums Support Back to top button for one page only

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #910404
    George

    I want to have the back to top button for one page only. I activate the back to top button from the Customizer and then add this class:

    body:not(.page-id-1259 a.generate-back-to-top) {
    	display: none;
    }

    It doesn’t work, though. Adding the !important rule doesn’t make any difference either.

    Is there a more elegant solution?

    #910601
    Leo
    Staff
    Customer Support
    #910611
    George

    Yes Leo, perfect!

    With the button disabled in the Customizer:

    add_filter( 'option_generate_settings','gm_remove_back_to_top' );
    function gm_remove_back_to_top ( $options ) {
        if ( is_page( 1259 ) ) {
            $options['back_to_top'] = 'enable';
        }
        
        return $options;
    }

    I knew there was a solution for that, like always!

    Cheers!

    #910614
    Leo
    Staff
    Customer Support

    Every option in the customizer should be filter-able ๐Ÿ™‚

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