Support » Fixing WordPress » Fancybox and WordPress

  • obidos

    (@obidos)


    Hi there,

    I have fancybox working for my site and want to call the images from a custom post type I created.

    I need to know how to call in the images from the custom post type in to the jquery that activates the fancybox gallery. Here is the code used to activate the gallery:-

    HTML

    <a id="gallery" href="javascript:;">Open gallery</a>

    jQuery

    $("#gallery").click(function() {
    	$.fancybox.open([
    		{
    			href : '1_b.jpg',
    			title : 'My title'
    		}, {
    			href : '2_b.jpg',
    			title : '2nd title'
    		}, {
    			href : '3_b.jpg'
    		}
    	], {
    		helpers : {
    			thumbs : {
    				width: 75,
    				height: 50
    			}
    		}
    	});
    });

    I don’t want to use the plugin. I would like to work this out as it’s a problem I come across quite a lot.

    Thank you kind people

  • The topic ‘Fancybox and WordPress’ is closed to new replies.