afterContent filter not finding block gallery items
-
Hi i’m using the afterContent filter (described in the Featherlight documentation) to put a button in the corner of the overlay.
this works$('.entry').featherlightGallery({ filter: ".wp-block-image a", // reaching the image link afterContent: //code to insert a link button in the corner... function() { this.$legend = this.$legend || $('<a class="moreinfo" target="_blank" href="" />').insertAfter(this.$content); this.$legend.attr('href', this.$currentTarget.find('img').attr('data-link')); this.$legend.text('i'); } )};
this doesn’t
$('.entry').featherlightGallery({ filter: "li.blocks-gallery-item a", // trying to reach the image link afterContent: //code to insert a link button in the corner... function() { this.$legend = this.$legend || $('<a class="moreinfo" target="_blank" href="" />').insertAfter(this.$content); this.$legend.attr('href', this.$currentTarget.find('img').attr('data-link')); this.$legend.text('i'); } )};
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘afterContent filter not finding block gallery items’ is closed to new replies.