Title: Fancybox and WordPress
Last modified: August 20, 2016

---

# Fancybox and WordPress

 *  [obidos](https://wordpress.org/support/users/obidos/)
 * (@obidos)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/fancybox-and-wordpress/)
 * 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.

## Tags

 * [featured image](https://wordpress.org/support/topic-tag/featured-image/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [obidos](https://wordpress.org/support/users/obidos/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/fancybox-and-wordpress/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
