Uh-oh issue: "The preview HTML did not include a closing </html

Hi there,
since yesterday I get this warning whenever I open a page.

I checked the forum and found a similar topic, but I habe no W3TC installed. No caching at all actually. What should I do about this…?

I tried to find the location of functions.php as you suggested in the other thread but with my WP being in German I can’t find my way in dashboard to Appearance and Editor. What I can offer is “Design” and “Customizer”? [Edit 11-11-17: Wordpress Editor found and installed now]
URL is hartig-coacht.de
Some hint would be great, thank you!
Regards, Karen

Hi @x-vision, I have the same issue. What version of Cornerstone are you running? I’m on 2.1.6.

Thanks

Hi redpupmedia,
same Cornerstone version running here. Hope this will work out soon :slight_smile:

Hi @x-vision

I rolled Cornerstone back to 2.1.3 and the error went away. I’m running X 5.2.4. I don’t know if that will work for you, but it’s worth a shot. Be sure to have a backup before doing any of this.

Hi Karen,

We would love to check your setup if you could provide credentials on a secure note.

@redpupmedia, please open a new thread and then provide your credentials there too. Thank you.

Hi Lely,
that would be great, thank you! Secure note coming up.
Regards, Karen

I’ve taken a look and this is because you added custom code to footer.php of the theme. This code is output after the closing HTML tag which makes the document invalid.

It looks like you’re adding a tracking script. The best way to do this is in functions.php using the wp_footer hook.


function custom_footer_code() {

?>

<!-- Your script here -->

<?php

}

add_action('wp_footer', 'custom_footer_code' );

Hi @x-vision

I’m having the same problem with Pro Content Builder. It started after updating to the latest version of Pro (Version: 1.2.6) yesterday.

Support topic: Content Builder Pro HTML Tag & Unresponsive Preview

I’ve replied to that thread as well. We can get things sorted out over there.

Hi Alexander,

right, I’ll check that. Just to make sure, do you suggest to add that custom code in functions.php of the theme or in child theme?

Thanks and regards
Karen

Hi Karen,

functions.php of a child theme would be best. Not the best idea to modify the parent theme in any way since those changes will be wiped out after updating in the future.

Thank you, Alexander! I’ll do that and keep you informed if it has worked out.

Regards, Karen

Let us know how it goes. Karen.

Hi there,
now this issue was tricky. It finally was a tech person that found the problem beneath. The whole thing is about the X-Google Analytics snippet. I had it installed for a year and it worked fine, but over here in Germany you need to have an opt-out installed nowadays, by law. That meant some variable with “>” had to be changed in the plugin:
if (document.cookie.indexOf(disableStr + ‘=true’) > -1) {

The x-snippet won’t accept the loss of “gt” though. You can change the script but as soon as you update it’s gone again. That means that users from countries where you need to offer a possibility to opt-out Google Analytics can’t use the X-snippet just like that. Would be great if you could work that over some day :slight_smile:

So my tech friend uninstalled the X-plugin and wrote the whole code into the functions.php now as you suggested and it seems as if the red uh-oh-alert is gone.

Cheers, Karen

Hi Karen,

Thanks for observations, I will place that on our issue tracker so our developers can take a look.

Thank you

Same problem here.

Any update on that ?

Thank you

Roberto

Hey Roberto,

There’s currently no update for that. Please stay tuned.

Thanks.

Hi,

The Uh=oh issue just started happening for me too, any updates on how to fix this?

Thanks,
Ariane

Hi, I tried deactivating my plugins and testing one by one, and it looks like slider revolution was causing the uh-oh issue for me.
Thanks, Ariane

Hi there,

Thanks for sharing.

You may try changing your slider settings in Problem handling section. Like the output and no conflict option.

Thanks!