- This topic has 14 replies, 5 voices, and was last updated 3 years, 6 months ago by vast.
-
AuthorPosts
-
October 22, 2020 at 6:01 am #1499721Andrei
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 #1499746DavidStaffCustomer SupportAny chance you can disable the Litespeed cache on the problem site ?
October 22, 2020 at 7:01 am #1499801AndreiHow 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 #1499829DavidStaffCustomer SupportYeah there was some CSS left over i assume before the last update.
Glad to be of help.October 22, 2020 at 7:43 am #1499862AndreiYeah, 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 #1500108DavidStaffCustomer 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 ).
October 22, 2020 at 9:01 am #1500166AndreiSure 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 #1500346LeoStaffCustomer SupportTry this CSS:
.generate-back-to-top .gp-icon svg { transform: none; }
October 22, 2020 at 12:35 pm #1500436AndreiThanks Leo!
Works like a charm!!
October 22, 2020 at 12:39 pm #1500438LeoStaffCustomer SupportNo problem π
October 27, 2020 at 1:42 am #1505805vastHi 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 #1506678TomLead DeveloperLead DeveloperYou should just need to replace this:
generate_get_svg_icon( 'arrow' )
With this:
generate_get_svg_icon( 'arrow-up' )
Let me know π
October 27, 2020 at 11:41 am #1506868vastThanks 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 #1506992TomLead DeveloperLead DeveloperWill add it for review in 3.1 π
October 27, 2020 at 2:58 pm #1507039vastGreat. 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.