You’ve probably noticed that some features of Customizr are not well interpreted by some outdated versions of Internet Explorer. The beloved zoom effects on the thumbnails for the featured pages and posts lists, for example, are not supported by them. Unfortunately, thumbnails links does not work either.
Add this snippet to your child theme functions.php to work around this issue.
add_action('wp_footer', 'ie_thumbnails_links'); function ie_thumbnails_links(){ ?> <script type="text/javascript"> jQuery(document).ready(function () { !function ($){ "use strict"; $.ThumbsWithLinks = function() { // grab all a .round-div var $round_divs = $("a").filter(".round-div"); // grab all wrapped thumbnails var $images = $(".thumb-wrapper img"); $images.each( function(i) { // let's wrap the thumb into the round-div link $(this).wrap('<a href="' + $( $round_divs[i] ).attr('href') + '" title="' + $( $round_divs[i] ).attr('title') + '"></a>'); // let's remove now useless round-div $($round_divs[i]).remove(); }); } }(window.jQuery); // detect if the browser is IE var ua = window.navigator.userAgent; var msie = ua.indexOf ( "MSIE " ); if ( msie > 0 ) // call our function for IE versions less than 11 if ( parseInt( ua.substring ( msie+5, ua.indexOf (".", msie ) ) ) < 11 ) jQuery.ThumbsWithLinks(); }); </script> <?php }
Where to paste this code? => in your functions.php file. I strongly recommend to create a child theme. Download a start-up child theme here.
Everything you need to know about child theme with Customizr here.
Read How to customize the Customizr WordPress theme? if have never used a functions.php file in a child theme.
5 thoughts on “Allow thumbnails links for IE10 and below”
Hello, I ask you to help. I would like to remove the effect of the frame around the thumbnail galleries.
I also noticed a bug, when I add a new gallery imposed “no link to click”, the code is in fact written correctly: [gallery link = "none" ids = "...."] but you get the same result as clicking link to the file.
Hi Luca,
the link issue, is actually a bug, IMHO.
Anyway I think you can fix both with this:
https://wordpress.org/support/topic/customizr-compatible-with-wp-canvas-gallery-plugin?replies=4#post-6758357
Are there any drawbacks to this snippet?
Considering that a substantial amount of users “forget” to update their systems and browsers, would it not make sense to merge this snippet in the theme?
Awesome work, Rocco! Apparently the links weren’t working on IE10, so I made one tiny mod to the code and it seems to be great on IE8, IE9 and IE10 now.
I changed this:
To this:
Cheers! Thanks for the fix!
Thank you very much Sarah, I thought ie10 wasn’t affected by this issue 😀
Snippet updated.