• What I am wanting to do is if you go to the above-mentioned page and click on the 2nd color, Bamboo Dusk an image pops up and I am wanting to add a slider carousel to that image that pops up. It does not matter if this is done with or without a plugin. I have tried a few different plugins, but did not have any success. So if you suggest a plugin please include the steps I need to take to achieve this.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi @kyvetteh,

    Please try this code:

    function ps_add_lightbox_image($content) {
           global $post;
           $pattern ="/<a(.*?)href=('|")(.*?).(bmp|gif|jpeg|jpg|png)('|")(.*?)>/i";
           $replacement = '<a$1href=$2$3.$4$5 rel="lightbox" title="'.$post->post_title.'"$6>';
           $content = preg_replace($pattern, $replacement, $content);
           return $content;
    }
    add_filter('the_content', 'ps_add_lightbox_image');

    Hopefully, this will help you.

    Thanks

Viewing 1 replies (of 1 total)

The topic ‘Adding slider carousel to an a href image’ is closed to new replies.