How to add fancybox lightbox in wordpress theme without using a plugin (3 posts)

  1. yampire
    Posted 3 years ago #

    I want my post images to open in a fancybox lightbox. I have two wordpress websites with two different themes. I am using this code for my images in the lightbox

    <div id="gallery-1" class="gallery galleryid-25830 gallery-columns-3 gallery-size-thumbnail">
    <img class="attachment-thumbnail alignleft" title="image-title" src="image-url" alt="" width="150" height="150" />

    This code works in one theme, but in the other theme it goes to the image's url. I checked my theme files and found that there is no jquery or js file for fancybox. So I am wondering how I can add these files to my theme and what I should change in my CSS file. Please someone, help me. I am new to coding.
    I have fancybox folder in other theme, it contains some images and jquery.fancybox-1.3.4. can i use them? and if yes, then how? plz someone help

  2. Digest WP
    Posted 3 years ago #


    There is a WordPress plugin that should make it easy for you.

    When adding fancybox yourself without a plugin you have to have a decent amount of coding knowledge. You would also have to use a rel="" attribute

  3. yampire
    Posted 3 years ago #

    I have a little knowledge of coding. Can you plz tell me how to do it?

Topic Closed

This topic has been closed to new replies.

About this Topic