• Resolved brad_magnus

    (@brad_magnus)


    I’ve got a Nivo Slider on a page in my theme. But when I add a link the images aren’t getting wrapped in anchor tags. I did add a bit of code to functions:

    add_filter('metaslider_nivo_slider_anchor_attributes', 'metaslider_rel_attribute', 10, 3);
    add_filter('metaslider_flex_slider_anchor_attributes', 'metaslider_rel_attribute', 10, 3);
    function metaslider_rel_attribute($attributes, $slide, $slider_id) {
            // add data-reveal-id attribute to <a>, with a value of 'myModal'
    	if ($slider_id == 2106) {
    	$attributes['data-reveal-id'] = 'video-carousel-slide-' . $slide['id'];
    	return $attributes;
    	}
    }

    But even when I remove that code it still isn’t working, and I don’t see how that’s affecting my ability to add links to slider images. You can see the production server here: http://resolute.server294.com/founders-companies/

    Screengrab of the metaslider dashboard: http://screencast.com/t/wzA7u1M4l

    Just updated to v2.5-beta2

    http://wordpress.org/plugins/ml-slider/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Brad,

    That function always needs to return $attributes, like this:

    add_filter('metaslider_nivo_slider_anchor_attributes', 'metaslider_rel_attribute', 10, 3);
    add_filter('metaslider_flex_slider_anchor_attributes', 'metaslider_rel_attribute', 10, 3);
    function metaslider_rel_attribute($attributes, $slide, $slider_id) {
            // add data-reveal-id attribute to <a>, with a value of 'myModal'
    	if ($slider_id == 2106) {
    	    $attributes['data-reveal-id'] = 'video-carousel-slide-' . $slide['id'];
    	}
            return $attributes;
    }

    Could you check your functions.php file for any other code? I’ve tested here and it should be working.

    Regards,
    Tom

    Thread Starter brad_magnus

    (@brad_magnus)

    That’s what it was! The return wasn’t in the right spot.

    Thank you for the response!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Links not working for any of the slides’ is closed to new replies.