Title: Scroll Bug?
Last modified: March 26, 2024

---

# Scroll Bug?

 *  [dloomis](https://wordpress.org/support/users/dloomis/)
 * (@dloomis)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/scroll-bug-2/)
 * Hi there! 
   I noticed that the drop down scroll doesn’t seem to be working correctly.
   I have a Table of Contents on the left side of all of my posts and instead of
   it taking you to the correct section it just scrolls you to the top. I deactivated
   the plugin and the links are working correctly (it just jumps instead of scrolling).
   Anyone else experiencing this? The WordPress Support requested I post something
   here to see if anyone else is experiencing the same thing.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscroll-bug-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17530626)
 * Hello,
 * The issue you’re having is because your HTML document begins with an invalid 
   tag (`<style />`):
 *     ```wp-block-code
       <style type="text/css" media="screen">
       							#is-ajax-search-result-4085 .is-highlight { background-color: #FFFFB9 !important;}
       							#is-ajax-search-result-4085 .meta .is-highlight { background-color: transparent !important;}
       							</style>
       						<!DOCTYPE html>
       <html lang="en-US" prefix="og: https://ogp.me/ns#">
       <head>
       ```
   
 * It should start with the `<!DOCTYPE html>` as the very first element, otherwise
   you’ll have issues with a lot of things including scrolling:
 *     ```wp-block-code
       <!DOCTYPE html>
       <html lang="en-US" prefix="og: https://ogp.me/ns#">
       <head>
       ```
   
 * Fix this, activate the plugin and everything should work. Let me know 🙂
 *  Thread Starter [dloomis](https://wordpress.org/support/users/dloomis/)
 * (@dloomis)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17532768)
 * Thank you Malihu!
   HTML is kind of new to me, so thank you for pointing that out.
   So I just added “<!DOCTYPE HTML>” to the top of my HTML, and reactivated the 
   plugin, but it still scrolls to the top. I have then again deactivated the plugin
   so the Table of Contents still works, but left “<!DOCTYPE HTML>” at the top. 
   Any other ideas?? Thank you!
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17532982)
 * No problem! It seems that the changes you made have not been applied on the frontend.
   Maybe you need to flush/clear your site’s cache?
 *  Thread Starter [dloomis](https://wordpress.org/support/users/dloomis/)
 * (@dloomis)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17538493)
 * Hmmm still doesn’t seem to be working… I tried clearing the website’s cache. 
   Any other ideas?
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17538888)
 * Can’t really say as I don’t know your backend or what plugins/theme you use. 
   Can you tell me how exactly you’re adding the `<!DOCTYPE html>`? Where do you
   edit the template(s)?
 * Also do you know who or which script adds the custom CSS in the top of your template?
   It seems that the CSS is for the “Ivory Search” or “Ajax Search” plugin(?)
 *  Thread Starter [dloomis](https://wordpress.org/support/users/dloomis/)
 * (@dloomis)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17545411)
 * Hi Malihu,
 * It’s added as a “HTML” block ([https://imgur.com/a/7CbYB3q](https://imgur.com/a/7CbYB3q)).
   I edit this by going directly into the post.
   And no I don’t know who or which
   script adds the custom CSS at the top… I use Ivory Search which is the search
   bar, so I’m assuming that! Is that what is messing it up?
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17545571)
 * Adding an HTML block in the post is not correct. You need to edit the actual 
   theme template. This can be done by going in “Appearance” > “Theme File Editor”
   and editing the head.php or header.php template (and delete anything that is 
   before the `<!DOCTYPE html>` tag).
 * You could also temporarily deactivate Ivory Search plugin and check if it fixes
   the issue.
 * If you need me to do this for you or you want to provide me with more details
   we can continue via email:
 * [https://manos.malihu.gr/contact](https://manos.malihu.gr/contact)
 * I’d be happy to assist 🙂
 *  Thread Starter [dloomis](https://wordpress.org/support/users/dloomis/)
 * (@dloomis)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17546092)
 * Got it! But editing the theme template, will I be adding this to every page? 
   I’m only using this HTML on a certain page. If it’s easier I can send you a message
   through that link?
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17546478)
 * Yes, [send me a message via email](https://manos.malihu.gr/contact). Editing 
   the theme template will apply to every page in your site and this is what you
   need. Nothing should be before the `<!DOCTYPE html>` tag. Your template(s) already
   have the tag, so you simply need to delete anything that is before/above it (
   like the `style` tag I posted in my original reply to this thread).
 *  Thread Starter [dloomis](https://wordpress.org/support/users/dloomis/)
 * (@dloomis)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17556551)
 * Great, I just sent you an email!
 *  [cholasimmons](https://wordpress.org/support/users/cholasimmons/)
 * (@cholasimmons)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17911324)
 * Hahahaha omg the number of weeks I’ve struggled with this, going back and fourth
   with my client simply because their original Developer left out the DOCTYPE. 
   Jeez 😂
   Thanks!
 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17915922)
 * [@cholasimmons](https://wordpress.org/support/users/cholasimmons/) Yes, this 
   is an issue I check frequently as it creates problems not only with smooth scrolling
   but with other plugins, scripts, APIs etc.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Scroll Bug?’ is closed to new replies.

 * ![](https://ps.w.org/page-scroll-to-id/assets/icon-256x256.png?rev=1401043)
 * [Page scroll to id](https://wordpress.org/plugins/page-scroll-to-id/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-scroll-to-id/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-scroll-to-id/)
 * [Active Topics](https://wordpress.org/support/plugin/page-scroll-to-id/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-scroll-to-id/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-scroll-to-id/reviews/)

## Tags

 * [doctype](https://wordpress.org/support/topic-tag/doctype/)
 * [fragment](https://wordpress.org/support/topic-tag/fragment/)

 * 12 replies
 * 3 participants
 * Last reply from: [malihu](https://wordpress.org/support/users/malihu/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/scroll-bug-2/#post-17915922)
 * Status: not resolved