WordPress fetching image title based on background url

  elementor, javascript, jquery, php, wordpress

I’m currently trying to add the image title to the slideshow media widget in elementor pro through the code attached here :

jQuery('.elementor-carousel-image').attr('id','slideshowImage')

var slideshowDiv = document.querySelectorAll("#slideshowImage");

for (var i = 0; i<slideshowDiv.length; i++) {
    var content = document.createTextNode("Title");
  slideshowDiv[i].appendChild(content);
}

As of now it is able to show the text "Title" at the top of every image. However i’m looking to attach the actual image title in the wordpress media. Is there a way to achieve this? The slideshow shows images based on the background property in css.

Source: Ask Javascript Questions

LEAVE A COMMENT