Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NextGEN gallery slideshow giving error

I've installed the latest version of NextGEN gallery (version 2.0.40). All other options like Basic Thumbnails, Basic ImageBrowser, Basic SinglePic are working fine but when I tried to create a Basic Slideshow then it's not working! I can only see the slideshow loading icon but no slideshow images. This is how I called the gallery to a page:

<?php echo nggShowSlideshow(1,300,200); ?>

I've check the error console & its shows following error:

TypeError: jQuery(...).nggShowSlideshow is not a function


timeout: 10000      });

I've searched for solution of this issue & some people suggested to change this:

jQuery(function($){
        jQuery('#<?php echo_h($anchor); ?>').nggShowSlideshow({
            //code here
        });

with this:

jQuery(document).ready(function($){
        jQuery('#<?php echo_h($anchor); ?>').nggShowSlideshow({
            //code here
        });

but it didn't worked for me! By the way, my Wordpress version 3.7.1.

Any ideas? Thanks.

like image 783
neshpro9 Avatar asked Aug 07 '26 04:08

neshpro9


2 Answers

This is kinda odd to answer my own question, but I want to state my findings here so that it might be helpful to others!

What I've figured out is, footer was missing in my page-templates! As most of the wordpress plugin's javascript files are being called through footer so if you miss <?php get_footer(); ?> in your page-templates then you may get such error like TypeError: jQuery(...).nggShowSlideshow is not a function! I've missed footer while working with custom page-templates.

like image 187
neshpro9 Avatar answered Aug 08 '26 21:08

neshpro9


This thread is old but I think it is necessary to add a small remark to the answer:

Don't call get_footer() if you don't need the footer. This function adds the footer-template to the output. I think there may be a good reason why there isn't a get_footer()-call in your template (or another template).

Basically, you are missing wp_footer(). Calling wp_footer() at the end of your body-tag us doing the job:

<body>
...
<?php wp_footer(); ?>
</body>
like image 35
Flocke Avatar answered Aug 08 '26 21:08

Flocke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!