WordPress 5.6 broke the slider
FYI, WordPress 5.6 broke the slider on my site.
I have restored previous snapshot, so no problem, but has anyone else had a problem? Would be grateful for a fix if so.
Stephen
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Dmytro Semenov on 09 Dec, 2020 10:09 PM
Hello Stephen,
Can you please elaborate on what/how exactly wasn't it working? And if you can provide a link to the staging version of your website that isn't working correctly - that would be great.
2 Posted by steve on 10 Dec, 2020 09:23 AM
I had some Javascript work done on the site and suspect this is the problem, if no one else had a problem. I shall investigate this further rather than bothering you more and get back if necessary. Thanks for the support!
3 Posted by info on 13 Dec, 2020 12:07 PM
Same problem here. After updating to WP 5.6 all sliders are broken.
Support Staff 4 Posted by Dmytro Semenov on 13 Dec, 2020 03:11 PM
Please link to the page with the issue.
5 Posted by info on 13 Dec, 2020 03:47 PM
https://u-neuhaus.com/
Support Staff 6 Posted by Dmytro Semenov on 13 Dec, 2020 04:14 PM
One of your plugins or the theme is adding defer attribute to all scripts of the page, which breaks execution order. Are you using any "performance optimization" plugins?
7 Posted by info on 13 Dec, 2020 06:01 PM
Ok. I found this within the functions.php from the theme.
--
//Defer Pasing JavaScript for entire website, including Plugins, but without jQuery.js
//Feel free to change "async" to "defer". $files will be excluded
function defer_parsing_of_js($url)
{
//Specify which files to EXCLUDE from defer method. Always add jquery.js
$files = array('jquery.js');
//let's not break back-end
if (!is_admin()) {
if (false === strpos($url, '.js')) {
return $url;
}
foreach ($files as $file) {
if (strpos($url, $file)) {
return $url;
}
}
} else {
return $url;
}
return "$url' defer='defer";
}
add_filter('clean_url', 'defer_parsing_of_js', 11, 1);
--
Any suggestions what to change here? Deleting the whole section and the slider works again. But I am not sure how this effects the rest of the theme …
Support Staff 8 Posted by Dmytro Semenov on 13 Dec, 2020 08:20 PM
You can try modifying to:
9 Posted by info on 14 Dec, 2020 05:01 AM
Thank you Dmitry, problem solved.
10 Posted by flaminio2 on 02 Jan, 2021 01:26 AM
Good day Dmitry and Happy New Year. I have the same issue, after updating to 5.6 the sliders are not working (the loading animation keep going without dispaying the pictures). Here is one of the pages where royalslider is in: https://www.fortbonifaciorent.com/the-fort-residences/1br-tfr38
Support Staff 11 Posted by Dmytro Semenov on 02 Jan, 2021 11:13 PM
@flaminio2 , your theme (or one of the plugins) is including jQuery and jQuery.Migrate incorrectly, thus you have multiple versions of them on the same page. Specifically these two script tags:
12 Posted by flaminio2 on 04 Jan, 2021 11:33 PM
Thanks Dmitry, the devs were able to fix the conflict. Now working.
13 Posted by Suzzz on 10 Jan, 2021 09:28 PM
Update to WP 5.6 also broke my home page slider https://www.missouriantiquemalls.com/ Your help would be appreciated.
Thanks
Support Staff 14 Posted by Dmytro Semenov on 11 Jan, 2021 02:20 PM
@Suzzz, you're using very old version of the plugin, consider updating. There is also a JS error from your theme or one of the plugins that may block the execution.
15 Posted by Shawn on 07 Jan, 2022 03:26 PM
This comment was split into a new private discussion: WordPress 5.6 broke the slider
Dmitry, if you're still around, I was wondering if you could help me resolve my slider issue after updating to WP 5.6.2: www.cjoscoe.org