Plugin Author
malihu
(@malihu)
Hello,
The issue you’re having is because your HTML document begins with an invalid tag (<style />):
<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:
<!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 🙂
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
(@malihu)
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?
Hmmm still doesn’t seem to be working… I tried clearing the website’s cache. Any other ideas?
Plugin Author
malihu
(@malihu)
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(?)
Hi Malihu,
It’s added as a “HTML” block (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
(@malihu)
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
I’d be happy to assist 🙂
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
(@malihu)
Yes, send me a message via email. 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).
Great, I just sent you an email!
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
(@malihu)
@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.