Hey @sean-h,
The Discover Spain Today site is having the exact same issue as others have reported here: Popular Posts disappeared after the WP 6.4 update.
TLDR;
The issue seems to be caused either by your theme and/or a third-party plugin. A temporary workaround has been shared on that thread.
Thread Starter
Sean
(@sean-h)
Hi Hector,
Yes, I saw that thread, I’ll consider implementing that workaround. In the meantime, I think it is WordPress themselves that has again introduced breaking changes, what with that seeming to be the only common denominator with this problem.
Thread Starter
Sean
(@sean-h)
I think I fixed it, using the free version of the Code Snippets plugin with this:
/**
* Removes CDATA tag from WordPress Popular Posts' inline script.
*/
add_filter( 'script_loader_tag', function($tag, $handle, $src) {
if ( 'wpp-js' === $handle ) {
if ( false !== strpos($tag, '/* <![CDATA[ */') ) {
$tag = str_replace('/* <![CDATA[ */', '', $tag);
}
if ( false !== strpos($tag, '/* ]]> */') ) {
$tag = str_replace('/* ]]> */', '', $tag);
}
$tag = str_replace(["\r", "\n"], '', $tag);
}
return $tag;
}, 99, 3 );
Just remember to flush any and all caches/CDN after implementing it.
Thread Starter
Sean
(@sean-h)
Meanwhile, the forum mods are deleting my other comments in the other threads, about the exact same problem. Come on guys, I for one know the drill. See my first post in this thread.
“Instead of doing the ‘I have the same problem’ in other’s posts, I thought I’d start a new one.”
Yeah, mods in general don’t love it when lots of people “pile on” the same topic. Some of my comments were deleted as well lol. It’s fine though, it does reduce noise so people won’t have to read through multiple comments to find the actual solution.
Thread Starter
Sean
(@sean-h)
Kind of like on fakebook when people seem to think they need to comment with ‘following’ in order to subscribe to a post, when you can in fact just subscribe without having to comment. But, you can actually do that too in these forums, subscribe without saying anything, or start your own topic, because yes, while some problems seem similar, they are often not.
Now I’m busy working through the ‘noise’ to see where my problem lies. So much for my Spanish siesta…
Thread Starter
Sean
(@sean-h)
Alrighty then, adding this to functions.php (with the free version of the Code Snippets plugin, so no child theme necessary) fixed it:
/** * Adds support for HTML5 script tags */ add_theme_support( 'html5', array('script') );
I think my intended siesta is now within reach…
With that all said, I have to wonder what’s going to happen when a more permanent fix is implemented.
I have already added a patch for this within the plugin as I know that not everyone reads the forum. Also, I don’t (and cannot) expect theme developers to add HTML5 support to their themes right away either.
Thread Starter
Sean
(@sean-h)
Just wondering what we should do with the temporary patch code in functions.php after the problem is really fixed?
Otherwise I’m going to mark this thread solved. Thanks again!
You can remove it afterwards, or you can keep it as it won’t cause any harm nor have any performance impact on your site (themes should be providing support for HTML5 stuff nowadays anyway, HTML5 has been out since 2008).
Thread Starter
Sean
(@sean-h)
Ok, good to know. I’m still wondering why Divi, of all themes, seems to have missed the ball on this, or maybe I’m missing something. Anyway, all seems fine for now.