- This topic has 11 replies, 4 voices, and was last updated 3 years, 2 months ago by Elvin.
-
AuthorPosts
-
June 21, 2021 at 4:01 am #1829356Harris
Hello
Can you please assist me to change the default “back to top” button with an image (png)?
Can you also assist me in moving it from the right side of the screen to the left please?Thanks
HarrisJune 21, 2021 at 5:27 am #1829445DavidStaffCustomer SupportHi there,
what type of image are you wanting to change it to? Will it be an SVG Icon or an image (jpeg/png)?
To move it to the left add this CSS:
.generate-back-to-top { right: auto; left: 30px; }
June 21, 2021 at 5:38 am #1829461HarrisHello!
Thanks for the reply.
It would be a png (already mentioned it).If you could also provide code for an svg it would be nice for future use.
June 21, 2021 at 5:51 am #1829477DavidStaffCustomer SupportDoh – must get more coffee or some new eyeballs
Try adding this PHP Snippet:
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="https://myURL.com/wp-content/uploads/2019/12/image-file.png" 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' ) ); }
Update the
<img src="https://myURL.com/wp-content/uploads/2019/12/image-file.png" alt="back to top" />
line for your image URL. This can also support an SVG file or be replaced with your<SVG>
HTMLJune 21, 2021 at 11:39 am #1830106HarrisHello!
Thanks once again.
Left alignment doesn’t seem to be working. I added the css to “simple css”.
And is there some way to remove the gray overlay(or is it a background) and the hover effect overlay?
Just keep the image in its original color in all states.June 21, 2021 at 12:19 pm #1830128YingStaffCustomer SupportHi Harris,
The link you provided needs a username and password.
Can you provide that? Thanks!
June 21, 2021 at 1:03 pm #1830166HarrisOh sorry! Its the staging site that needs credentials.
I have provided themJune 21, 2021 at 1:43 pm #1830200YingStaffCustomer SupportI believe there’s an error in the code before David’s CSS in simple CSS.
Can you try to remove the other CSS to test?
Let me know ๐
June 21, 2021 at 10:51 pm #1830443HarrisHello,
Yes, there was an unclosed bracket. I fixed it and it properly aligns on the left.
Can you please help me on the other part of the question?“is there some way to remove the gray overlay (or is it a background) and the hover effect overlay?
Just keep the image in its original color in all states.”June 21, 2021 at 11:06 pm #1830454ElvinStaffCustomer SupportHi Harris,
The hover effect you see is from this CSS:
a.generate-back-to-top:hover, a.generate-back-to-top:focus { background-color: rgba( 0,0,0,0.6 ); color: #ffffff; }
It’s the background color change. You can change this value on Appearance > customize > Color Footer. It’s these 2 settings – https://share.getcloudapp.com/wbu6bPnm
June 21, 2021 at 11:56 pm #1830472HarrisThanks everybody.
Everything working fine.June 22, 2021 at 1:00 am #1830542ElvinStaffCustomer SupportNo Problem. Glad to be of any help. ๐
-
AuthorPosts
- You must be logged in to reply to this topic.