Fluidbox is a jQuery script by Terry Mun for “opening images seamlessly in a lightbox on your page without interruption”.
In this article I show how Fluidbox can be incorporated in WordPress.
Upload fluidbox.css to your child theme’s directory/css (create ‘css’ directory if not existing).
Upload jquery.fluidbox.min.js to child theme’s directory/js (create ‘js’ directory if not existing).
Create a file named fluidbox-init.js in the same location having this code:
|1 2 3|
Add the following in child theme’s functions.php:
|1 2 3 4 5 6 7 8 9 10 11 12|
We have set Fluidbox to look for and work on any images that are linked to anchor element having a class of fluidbox. You can add more selectors (comma separated) in fluidbox-init.js if you wish.
Sample HTML in a Page/Post/widget: