diff --git a/wp-admin/js/custom-header.js b/wp-admin/js/custom-header.js index 9243498175..05cc89a9e2 100644 --- a/wp-admin/js/custom-header.js +++ b/wp-admin/js/custom-header.js @@ -1,10 +1,13 @@ (function($) { + // Fetch available headers and apply jQuery.masonry + // once the images have loaded. + $( function() { + var $headers = $('.available-headers'); - var headers = $('.available-headers'); - headers.imagesLoaded( function() { - headers.masonry({ - itemSelector: '.default-header' + $headers.imagesLoaded( function() { + $headers.masonry({ + itemSelector: '.default-header' + }); }); }); - -})(jQuery); +}(jQuery));