WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. yampire
    Member
    Posted 1 year 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" />
    </div>

    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
    Member
    Posted 1 year ago #

    Hello,

    There is a WordPress plugin that should make it easy for you.
    http://wordpress.org/extend/plugins/fancybox-for-wordpress/

    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
    Member
    Posted 1 year 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