Archived topic
Strange - Back to Top Button points downwards
4 replies · Started by spirospan on June 13, 2021
Hi. I face a strange issue with all of my sites.
Specifically, when in "General Settings" i choose "SVG" instead of "Font" in the "Icon Type" selection, the displayed arrow is pointing downwards. If I change the option to "Font" type, the arrow points upwards as it should.
Am i missing something, so that i can use SVG but the BACK TO TOP arrow to show upwards?
* Im using GP Premium Version 2.0.2
Thanks in advance
Spiros
Hi there,
That's strange. Are you using any custom functions at all?
Let me know :)
Hello Leo,
Hmmm yes indeed. I use a snippet in order to remove nofollow from "Back to Top" as i had an issue. So i turned the snippet off and the problem was solved. But i need it to work. So the code is as below. What should i change?
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" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="%2$s" data-start-scroll="%3$s">
<span class="screen-reader-text">%5$s</span>
%6$s
</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' ) ),
esc_html__( 'Scroll back to top', 'generatepress' ),
generate_get_svg_icon( 'arrow' )
);
}
Update!
I changed the last line from that snippet... from generate_get_svg_icon( 'arrow' ) to generate_get_svg_icon( 'arrow-up' )
problem solved.
Thanks alot Leo, because you gave me direction to look :)
Glad to hear :)
Good job!