Archived topic
to top button suddenly invisible
21 replies · Started by Axel on December 5, 2022
hi there,
strange thing to be encountered lately...
to-top-button is activated within customizer (and for aeons) but currently not visible any more. strange enough it is there within the sites html as following:
<a title="Nach oben scrollen" rel="nofollow" href="#" class="generate-back-to-top generate-back-to-top__show" style="opacity:0;visibility:hidden;" data-scroll-speed="400" data-start-scroll="300">
i dont know what is injecting this code, exacly the style part that obviously prevents showing the button. if deactivating totop it is missing within code as expected. reactivating again - same thing.
functionality is there, but simply wont show up.
tried hunting down possible glitches by deactivating plugins - no change.
no caching and no minifying going on staging site ...
glad for any hint how to possibly solve this!
thanks in advance for your efforts.
Hi Dasigna,
The site is asking for credentials so we can view it. Can you share the credentials?
Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Can you disable all plugins temporarily as well while we check?
uuups - sorry. forgot about it.
credentials added. thanks.
follow-up:
... tried again meanwhile - deaktivating ALL plugins changes nothing in regards of the totop-button.
same behaviour; being there but not showing up due to this nasty little inline css ...
Hi there,
if i check the DOMContentLoaded hook on that back to top button i can see several JS scripts that would affect it.
The only script that includes inlining those specific styles is the isotope.pkgd.min.js
Which is loaded by elementor-extras plugin:
../wp-content/plugins/elementor-extras/assets/lib/isotope/isotope.pkgd.min.js?ver=STAGING-3.0.4
hi david,
thanks for looking - but:
cant quite follow where you see this script firing the inline css for totop ... confused.
nevertheless, disabling ALL plugins the issue still persits. although theres only one script loaded:
wp-content/themes/generatepress/assets/js/back-to-top.min.js?ver=STAGING-3.2.4
nothing else.
same behaviour as before. so i dont think your approach leads to the issue sadly.
currently disabled everything, so you might have a look again by yourself?
thanks :)
Is there any page caching on the server ? If so can that be cleared ?
currently plain staging server... no caching, no minifying, no plugins - no nothing.
just plain wordpress, content and gp (even no pro...).
Any child theme ?
touché ...
your're by far smarter than i am :)
deactivated gp child - and this nasty little thing is there again.
must be this part of php for the custom totop-icon that caused the malfunction lately:
add_filter( 'generate_back_to_top_output', 'tu_custom_back_to_top_icon' );
function tu_custom_back_to_top_icon() {
printf(
'<a title="%1$s" rel="nofollow" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="%2$s" data-start-scroll="%3$s">
<img src="...wp-content/uploads/div/totop-arrow.svg" alt="Back to top" />
<span class="screen-reader-text">%5$s</span>
</a>',
esc_attr__( 'Scroll back to top','generatepress' ),
absint( apply_filters( 'generate_back_to_top_scroll_speed', 400 ) ),
absint( apply_filters( 'generate_back_to_top_start_scroll', 300 ) ),
esc_attr( apply_filters( 'generate_back_to_top_icon','fa-angle-up' ) ),
__( 'Scroll back to top','generatepress' )
);
}
so i assume we need a better piece of code for the custom icon ... :/
What was the original need for the tu_custom_back_to_top_icon function ?
... probably just leave out the 'style' part?
original need was just the custom svg-icon.
Ah ok, then yes, just delete: style="opacity:0;visibility:hidden;"
... just tested; works without the 'style' attributes.
must have had a reason they where there in the past, but better without now seemingly.
or any better suggestion from your side?
edit:
you already confirmed. bits traveling too slow from one end of the world to the other, sometimes ;/