• Ameisenman

    (@ameisenman)


    Hi,
    I want to add the fancybox effect to all images inside a post which are linking to the original image. For this purpose I need to add the css-class property to the surrounding <a>-Tag of the image. How can I do this?

    So far I came to a result:

    function addFancybox($content)
    {
    if (preg_match_all('/<a.*?><img.*?<\/a>/',$content,$matches))
    {
    print_r($matches);
    }
    }
    add_filter( "the_content", "fancyfilter" );

    But how to continue???

    Thanx in advance!!!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Adding a css class to the linked images’ is closed to new replies.