Title: [Plugin: Flickr Gallery] jQuery Error: flightbox not a function
Last modified: August 20, 2016

---

# [Plugin: Flickr Gallery] jQuery Error: flightbox not a function

 *  [Benjamin Sommer](https://wordpress.org/support/users/benjaminsommer/)
 * (@benjaminsommer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/)
 * Firefox 8.0 produced the following error with your plugin, while viewing a post:
 * > $(“img.flickr.square,img.flickr.thumbnail,img.flickr.small”).flightbox is not
   > a function
 * [http://wordpress.org/extend/plugins/flickr-gallery/](http://wordpress.org/extend/plugins/flickr-gallery/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [kwiliarty](https://wordpress.org/support/users/kwiliarty/)
 * (@kwiliarty)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395179)
 * I was having the same problem. I believe that the answer and the solution are
   to be found here:
 * [http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers)
 * Looking at the code in the plugin file jquery.lightbox.js it seems that it is
   not using ‘no-conflict’ mode. I wrapped the JavaScript as described at the link
   above. Now the error is gone and the lightbox works.
 *  [timmmmyboy](https://wordpress.org/support/users/timmmmyboy/)
 * (@timmmmyboy)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395181)
 * I hate to sound like an idiot kwilliarty but would you be willing to give the
   dumbed down version of which code needs to be changed and what to change it to?
   I tried a few different things in that .js file but I still get the javascript
   error and it prevents other scripts on my page from working.
 *  [timmmmyboy](https://wordpress.org/support/users/timmmmyboy/)
 * (@timmmmyboy)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395182)
 * Fixed my own issue. Realized you were talking about the code in **flickr-gallery.
   php** and not the .js file. For those who see this (and maybe the developer) 
   you need to do the following:
 * In the file **flickr-gallery.php** Go to line 1431. You should see the following
   code:
 *     ```
       <script type="text/javascript">
       				(function($){
       					$(function(){
       						$("img.flickr.square,img.flickr.thumbnail,img.flickr.small").flightbox({size_callback: get_sizes});
       					});
       				})(jQuery);
       			</script>
       ```
   
 * The developer meant to put it in no conflict mode at the beginning there but 
   there’s an extra $function line that is not necessary. Here is the proper code
   you can replace that section with that will not throw an error:
 *     ```
       <script type="text/javascript">
       				(function($){
       						$("img.flickr.square,img.flickr.thumbnail,img.flickr.small").flightbox({size_callback: get_sizes});
       					});(jQuery);
       			</script>
       ```
   
 *  [kwiliarty](https://wordpress.org/support/users/kwiliarty/)
 * (@kwiliarty)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395185)
 * Hi timmmmyboy,
 * I was in fact talking about the jquery.lightbox.js. I wrapped the JavaScript 
   in that file with these lines:
 *     ```
       jQuery(document).ready(function($) {
       ...
       });
       ```
   
 * That change worked for me.
 * I wonder if we are somehow looking at different versions of the code. (I have
   1.5.2). I find the code you mention in flickr-gallery.php around line 1074. I
   don’t have a line 1431. If I unmake my own change and apply the change you describe
   the lightbox stops working for me.
 *  [naphznoudha](https://wordpress.org/support/users/naphznoudha/)
 * (@naphznoudha)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395186)
 * hi keiliarty, how to put that code? i have the same problem
 *  [kwiliarty](https://wordpress.org/support/users/kwiliarty/)
 * (@kwiliarty)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395187)
 * You have to edit the file in the plugin folder. The path to the file withing 
   the plugin folder is:
 * /flightbox/jquery.flightbox.js
 * The very beginning of the script that works for me (starting right after the 
   commented head-matter) looks like this:
 *     ```
       jQuery(document).ready(function($) {
       ;(function($){
           $.flightboxIsVideo = false;
       ```
   
 * where the very first line is the one that I added. The very bottom of my file
   looks like this:
 *     ```
       }
       })(jQuery);
       });
       ```
   
 * where the very last line is the one that I added. Other solutions maybe be possible
   or better. At least for me, this does the trick.
 *  [seanbelly](https://wordpress.org/support/users/seanbelly/)
 * (@seanbelly)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395215)
 * I think I found an even better solution, find a plugin which works!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: Flickr Gallery] jQuery Error: flightbox not a function’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/flickr-gallery.svg)
 * [Flickr Gallery](https://wordpress.org/plugins/flickr-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flickr-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flickr-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/flickr-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flickr-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flickr-gallery/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [seanbelly](https://wordpress.org/support/users/seanbelly/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-flickr-gallery-jquery-error/#post-2395215)
 * Status: not resolved