$('.cart6 .mini-gallery .img').click(function(){ var index = $(this).index(); var imageUrl =" ../images/es4-big"+(index+1)+".jpg"; $('.big-img').css('background-image', 'url(' + imageUrl + ')'); }); When clicking on a picture, it changed to a large one from the images folder. When transferring to WordPress, the links stopped working. How to fix?