I have very little experience with WordPress, but my attempt to set everything up so far went fairly well. Where I'm struggling with now, is that none of the Astra starter templates seem to work - they all break and generate invalid html like this:
<img src="\"https://websitedemos.net/digital-agency-08/wp-content/uploads/sites/850/2021/05/about.jpg\"" alt="\"\"" size-full\"="">
The whole page is covered in these:
This seems some weird code sanitation issue? I tried searching for the problem, but couldn't find anything.
I checked system requirements and Tools > Site Health, everything related to this seems fine.
I'm running an Ubuntu server with PHP8.0 and NGINX. Minimum requirements for Astra templates are met.
Any ideas how to approach this, or where to investigate what could be wrong? What infos could I add to my question to give more clues?
CodePudding user response:
From: https://wordpress.org/support/topic/imported-template-is-broken-with-gutenberg-as-the-page-builder/
I’ve since tried this with several Astra templates, all have the same problem – wrongly slash-escaped quotes in the post content.
I tracked the problem down to a “Gutenberg Content Data Fix” as it is named in the Astra plugin code comments.
In file wp-content/plugins/astra-sites/inc/importers/wxr-importer/class-astra-wxr-importer.php there is an if branch apparently run in the case of Gutenberg builder, explicitly adding the slashes that actually breaks the page content:
$data['post_content'] = wp_slash( $data['post_content'] );
If I comment out this line, the template seems to get imported fine.
That fixes it!!!