- This topic has 14 replies, 5 voices, and was last updated 1 year, 8 months ago by
vast.
-
AuthorPosts
-
October 22, 2020 at 6:01 am #1499721
Andrei
Hello folks,
David advised me to create a new topic about the back-to-top arrow.
I’ve got 2 websites using the generatepress, and on one of them the icon is pointing downwards instead of upwards πShared 2 urls in the section below, for further details.
Cheers
October 22, 2020 at 6:27 am #1499746David
StaffCustomer SupportAny chance you can disable the Litespeed cache on the problem site ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 22, 2020 at 7:01 am #1499801Andrei
How come I didn’t think about that.. most likely it’s the caching plugin indeed as that’s the only major difference between the sites.
Unfortunately, I’m not the only one managing the sites and I’m not allowed to disable the plugin. I’ll mark this ticket as solved then π
Thanks, David for mentioning the plugin.
Cheers
October 22, 2020 at 7:22 am #1499829David
StaffCustomer SupportYeah there was some CSS left over i assume before the last update.
Glad to be of help.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 22, 2020 at 7:43 am #1499862Andrei
Yeah, you’re right.
Disabled litespeed for a bit, cleaned CDN cache and the arrow is fine. Once I re-enable litespeed, the arrow is inversed again – guess I can live with that. At least the cause is known now π
Cheers
October 22, 2020 at 8:13 am #1500108David
StaffCustomer SupportIf you want i can provide some CSS to resolve that? Will need to see the site again though ( Resolving a topic removes the private info ).
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 22, 2020 at 9:01 am #1500166Andrei
Sure thing! if there’s some css magic to solve it why not π
I put again the website url in the private section.Cheers David!
October 22, 2020 at 11:33 am #1500346Leo
StaffCustomer SupportTry this CSS:
.generate-back-to-top .gp-icon svg { transform: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 22, 2020 at 12:35 pm #1500436Andrei
Thanks Leo!
Works like a charm!!
October 22, 2020 at 12:39 pm #1500438Leo
StaffCustomer SupportNo problem π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/October 27, 2020 at 1:42 am #1505805vast
Hi Leo, David,
When applying the filter
generate_back_to_top_output
, it appears to change the HTML span class fromspan class="gp-icon icon-arrow-up">
to `<span class=”gp-icon icon-arrow”>.This results in the arrow facing down rather than up. Is there a an additional attribute so that it generates the relevant HTML elements.
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' ) ); }
October 27, 2020 at 9:52 am #1506678Tom
Lead DeveloperLead DeveloperYou should just need to replace this:
generate_get_svg_icon( 'arrow' )
With this:
generate_get_svg_icon( 'arrow-up' )
Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 27, 2020 at 11:41 am #1506868vast
Thanks Tom. That worked! It wasn’t in any of the documentation we could find.
Would it also be possible to move inline element styles e.g.
style="opacity:0;visibility:hidden;"
that is currently included as an attribute in<a title="Scroll back to top" aria-label="Scroll back to top" rel="nofollow" href="#" class="generate-back-to-top" style="opacity:0;visibility:hidden;" data-scroll-speed="400" data-start-scroll="300">
to an externalized CSS file in the next release?
The reason is that when content security policies are applied, inline CSS styles are blocked from executing unless they are accompanied by a SHA hash for instance.
October 27, 2020 at 1:59 pm #1506992Tom
Lead DeveloperLead DeveloperWill add it for review in 3.1 π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 27, 2020 at 2:58 pm #1507039vast
Great. Thanks for looking into it. It’ll go a long way to minimizing console errors and blocked resources.
-
AuthorPosts
- You must be logged in to reply to this topic.