[Support request] Moving back to top button

Home Forums Support Moving back to top button

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #330363
    Grant

    Hi,

    By default the back to top button is fixed to the bottom right of the page. Is there a way to it so it’s fixed within my footer?

    The site I am working on currently, http://staging.cbfcreative.co.uk/, I’d like to the back to top button to float inline inline with the header ‘Studio’ and the right hand side of the block. It should be noted this footer is created using elementor and GP Hooks.

    Thanks in advance

    GeneratePress 1.3.46
    #330500
    Tom
    Lead Developer
    Lead Developer

    Good question!

    Try this PHP:

    add_action( 'after_setup_theme','tu_move_back_to_top' );
    function tu_move_back_to_top() {
        remove_action( 'wp_footer','generate_back_to_top' );
        add_action( 'generate_before_footer_content','generate_back_to_top' );
    }

    Then this CSS:

    .site-footer {
        position: relative;
    }
    
    a.generate-back-to-top {
        position: absolute;
        top: 40px;
        bottom: auto;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.