- This topic has 9 replies, 2 voices, and was last updated 3 years, 2 months ago by
David.
-
AuthorPosts
-
November 19, 2019 at 11:13 am #1067694
Dan
Hi,
Since the new WP update, whenever I make a change to the WP text editor and I have the preview page open, the page auto refreshes and goes back to the top of the page (makes editing slower).
I posted on the WP forum and they said it wasn’t them.
I deactivated all plugins and installed 2020 theme in troubleshooting mode – the problem went away.
I switched back to normal mode and reactivated Generatepress but left all the plugins off – the problem returned.
If you could provide some thoughts on how to fix that would be great.
Site:
Thanks.
November 19, 2019 at 11:32 am #1067709David
StaffCustomer SupportHi there,
do you have any custom functions in a Child Theme or the GP Hooks?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 19, 2019 at 11:43 am #1067715Dan
Hi,
I have a hook using the elements for Amazon One Link plus the copyright element for the copyright in the footer. No child theme.
November 19, 2019 at 3:36 pm #1067852David
StaffCustomer SupportJust to be clear – is it the Preview window that returns to the Top when it is updated? Or the editor window?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 20, 2019 at 12:56 am #1068101Dan
It’s the preview page – the editor stays the same.
November 20, 2019 at 5:24 am #1068317David
StaffCustomer SupportI am not sure it this is a browser, install or setup thing – but i just tested GP, TwentyNineteen and TwentyTwenty and all three refresh the page back to the top.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 20, 2019 at 5:31 am #1068322Dan
So it’s more likely to be a WordPress issue?
November 20, 2019 at 7:58 am #1068644David
StaffCustomer SupportI think its more related to the browser and WP doesn’t pass any script to counter the default scrollTop position on refresh.
You’re site is using jQuery so you could try this script.
<script> $(window).scroll(function() { sessionStorage.scrollTop = $(this).scrollTop(); }); $(document).ready(function() { if (sessionStorage.scrollTop != "undefined") { $(window).scrollTop(sessionStorage.scrollTop); } }); </script>
You can add it to your site using a Hook Element:
1. Create New Hook.
2. Add the Script to the content
3. Select theWP_footer
hook
4. Select Display Rules –
Location: Entire Site
Users: Logged In ( so it won’t effect visitors ).Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 20, 2019 at 11:09 am #1068914Dan
Hi I gave the code a try but it didn’t work.
Cheers.
November 20, 2019 at 3:22 pm #1069306David
StaffCustomer SupportOdd its working for me – do you want to add the script and remove the Users display rule so i can take a look?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.