Add fancybox to all images in WordPress

Another quick WordPress snippet.

Assuming that you have fancybox linked up to your WordPress install you can add the following to your theme’s functions.php file to open all images that are linked to their full size image with jQuery Fancy Box:-

// Add Fancy Box to Images
function auto_fancy_box(){
 if (!is_single() && !is_page())
 <SCRIPT TYPE="text/javascript">

About the Author
Add fancybox to all images in Wordpress Add fancybox to all images in Wordpress 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g


A highly experienced Web Designer / Web Developer (Webflow, WordPress, Weebly & Custom), Front-end / Back-end Developer & New Media Specialist, with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries, built up over a number of years.