Preview HTML Does Not Include a Closing Tag

Recently updated to 5.2.5 & Cornerstone 2.1.7 on https://keyholesoftware.com. I have begun getting this error when loading the Cornerstone editor:

I read in another thread to fix the problem by adding this to my child theme’s functions.php:

add_filter( ‘w3tc_can_print_comment’, ‘__return_false’ );

Unfortunately, when I do, it states this:

Scrape nonce check failed. Please try again.

And won’t let me add the script to the file.

Please help! It’s making my content display incorrectly in Cornerstone.

Hi there,

The workaround above is only valid if you use the W3c Cache plugin. If not then the error is caused by an unclosed HTML tag for the page.

Try to check all the codes you have added to the elements on the page to find the error regarding the HTML. You can use the tool below to find out it is valid HTML or not:

https://www.freeformatter.com/html-validator.html

Thank you.

I should have stated that I do have the W3TC plugin, sorry.

It is making things display incorrectly in Cornerstone. For example, there is a blank accordion showing on the live site that I’m unable to delete because it is not displayed at all in cornerstone.

But this is shown live: https://keyholesoftware.com/services/technology-consulting/conversational-applications/

Hi There,

Please check your text and raw code elements for html syntax mistakes, if you cannot find any mistakes please provide your login credentials and the specific page where you are facing the issue on a secure note.

Thanks

Thank you. I didn’t find any syntax errors so I have responded privately with credentials.

Hello There,

I have logged in to your site and investigated the issue. I found out that you have modified the footer.php file and added a line of code which is the cause of the issue.

To resolve this, you will have to do the following:
1.) Please login to your FTP and browse in the child theme’s folder wp-content/themes/x-child/.
2.) Edit footer.php and remove the code you have added.
3.) In your child theme’s functions.php file, you will have to insert this code instead:


// Insert HubSpot embed code
// =============================================================================
function add_hubspot_code() { ?>

  <!-- Start of HubSpot Embed Code -->
    <script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/1271134.js"></script>
  <!-- End of HubSpot Embed Code -->
  
<?php } 
add_action('wp_footer', 'add_hubspot_code'); 
// =============================================================================

4.) The error “Scrape nonce check failed. Please try again.” when saving your changes in the WordPress File editor has just been introduce in WordPress 4.9 (https://developer.wordpress.org/reference/functions/wp_start_scraping_edited_file_errors/). This could be an issue in the latest release of WordPress. Please edit the child theme files manually instead at the moment.

Please let us know how it goes.

Thank you! I made the changes manually and that seemed to fix the html error. That is great!! Really appreciate your help.

In regards to the display issue o Cornerstone, I ended up recreating the section content and deleting the old copy, which deleted the phantom accordion.

Thanks for all of your help!

Hey There,

You’re welcome! We are just glad we were able to help you out.
We really appreciate for letting us know that it has worked for you.

Have a nice day and take care!

Cheers

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.