What is Fancybox?

Click on the image of rocks below to see it in action.

Pretty rocks
Fancybox demo: click image to view
Pretty wheat
Fancybox demo 2

Adding Fancybox to images

Fancybox is automatically applied to WordPress galleries in the Meerkat theme, and no action is required on your part.

To apply fancybox to an image not in a gallery, you’ll need to edit the image details in the visual editor and provide the following values:

  • Link To should be set to Media File.
  • Link Rel is optional, but if you have multiple images you want to display in the same fancybox as a slideshow, you’ll need to use the same Link Rel value for all of them.
  • Link CSS Class should be set to fancybox.


The resulting HTML will look like this:
<a href="" class="fancybox" rel="foo"><img loading="lazy" src="" alt="Pretty rocks" width="300" height="214" /></a>

Adding Fancybox to video

This┬ácan only be done in HTML/text mode. Add the classes “type-video” and “fancybox-video” to your link. Point your link at the URL of the video on YouTube or Vimeo. The play icon will be added automatically by applying the link classes, there’s no need to have it be part of your image.

<a class="type-video fancybox-video" href="">
<img loading="lazy" class="noborder" src="" alt="New Environmental Center" width="426" height="235" />

Demo of Fancybox video

New Environmental Center