Limited Time Offer

Save 50% on MetaSlider Pro!


Get MetaSlider
800,000+ WordPress sites are already using MetaSlider!

MetaSlider Documentation


Use this filter to modify or add attributes to each slide image tag.

{type} can be flex, coin, responsive or nivo.



(array) (required) Default image attributes (eg width, height, src).


(array) (required) Slide data


(int) (required) Slideshow ID


Add rel attribute

This example will add a ‘rel’ attribute of ‘lightbox’ to each slide in the slideshow. Eg, <img width=’x’ height=’x’ src=’x’ rel=’lightbox’ />

function metaslider_add_rel_attribute_to_images($attributes, $slide, $slider_id) {
        $attributes['rel'] = 'lightbox';
	return $attributes;
add_filter('metaslider_flex_slider_image_attributes', 'metaslider_add_rel_attribute_to_images', 10, 3);

Start Using Your Slider Today!

Create and publish WordPress slideshows in minutes… What are you waiting for?