Site logo

Archived topic

Back to top customization

32 replies · Started by Richard on July 19, 2018

Viewing posts 16–30 of 33

Correct :D Sorry!

haha my bad... i did think why would anyone want it on screen all the time lol!
Ok you'll have to bear with me, it lives in its own hook. So i all see if we can generate it as a static element in the footer... hmmm

And if we turn off the footer in GP and put the GP button in an Elementor widget? Just a thought.

I think that did the trick!

I added the snippet:

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' );
}

This CSS:

.site-footer {
position: relative;
margin-top: -100px;
}

a.generate-back-to-top {
position: absolute;
top: 40px;
bottom: auto;
}

Notice, that I had to a negative top margin to the site footer, because it had created a white space below the site content.

Thanks, again, Dave!

Would you mind checking it on your end?

Yep, looking good at my end!
Glad we got there in the end.

Oh, crud! On the subpages it added the back-to-top twice! Over the email address box in the footer.

And minus margin has the content stuck below the footer.

I know why! back in a bit lol

OK the second icon is a actually an icon you have in the elementor content.
Can try moving it after the widgets using the generate_after_footer_widgets hook

I deleted the global Elementor global footer (the home page wasn't in the condition), and added the footer in the global Elementor page template. Then I deactivated all elements and made it full-width (which I could have done globally in the new GP options!), and that did it!

It sometimes makes sense not to create global footers or headers in Elementor, and instead just make them part of a page template.

The only is that when it scrolls to the top, it doesn't go all the way to the top for some reason.

I think that's because there's two scrollbars on the page. Any particular reason for that?

Hey Tom!

Not that I believe. Any ideas how to eliminate one or the other?

Thanks!
Richard

It looks like this CSS is causing that:

html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

Removing the overflow from the html gets rid of it.

This archived topic is closed to new replies.