Add surrounding div, custom class & rel to images
-
Hi there – I’m trying to add a surrounding div, custom class and rel to the WordPress default image upload function.
Currently if you add an image you would see something like this:
/image.jpg"><img src="https://www.website.co.uk/wp-content/uploads/2012/08/image-150x150.jpg" alt="" title="" width="150" height="150" class="alignnone size-thumbnail wp-image-1455" /></a>
I’d like to get it so that it looks like this:
<div class="masonryImage"> <a rel="fancybox-button" href="https://www.website.co.uk/wp-content/uploads/image.jpg"><img src="https://www.website.co.uk/wp-content/uploads/2012/08/image-150x150.jpg" alt="" title="" width="150" height="150" class="alignnone size-thumbnail wp-image-1455" /></a> </div>
…with an additional surrounding div, custom class and rel added to the link
Is this possible please? – I’m pretty sure its do-able in the media.php file but I’m struggling to make sense of it
Many thanks
[Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add surrounding div, custom class & rel to images’ is closed to new replies.