wordpress snippets last updated   : September 29, 2014
we now have 639 snippets

Add rel=”lightbox” to all images embedded in a post

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will add a rel=”lightbox” attribute to all images embedded in your post. Also note that on line 05 you can change the rel=”lightbox” to whatever you need as some image viewer scripts will use rel=”thumbnail” for example. This snippet will also add the post title as the title attribute of the images anchor tag.

read more