Work with Nextgen Gallery? (43 posts)

  1. Chris
    Posted 3 years ago #

    Anyone have any tips on getting this plugin to work with the Nextgen Galley for loading images? Would be super handy for pages with a high amount of images.


  2. thisismyalterego
    Posted 3 years ago #

    I have exactly the same question and / or problem.
    the web is full with this question but no answers so far.

    At least a comment by the developer would be nice.

  3. thisismyalterego
    Posted 3 years ago #

    Hey there! I've figured out the problem - and solved it.
    When you look into the plugin directory, you need to edit something in the following file:

    on the very bottom there is a line with the following content:
    "function shouldLoadJavascript() {"

    after that there is an if-clause you can comment it out or delete it.
    This clause forces the script to stop when wordpress is on a single page (single post, normal pages and so on) and only activates the script (return true) when on a multipager (home, blog, archive, etc)

    after that it runs like we want it.

    There is only one minor thing (navigation below next gen gallery behaves strange) but I will look into it too.

    Hope that helps mate!

  4. thisismyalterego
    Posted 3 years ago #

    I also made a fix to the lightbox "prettyPhoto", so it still works after the dynamic reload and a fix to a bunch of other NGG bugs too. Just leave me a message if you are interested in this too, I get updates for this post by email.

    The reason why I am not posting it here directly is because I've never got a "thank you" on one of these boards when I've posted helpful stuff. Maybe this is the only possibility to get some ;)

    BTW: To make infinite scroll work you need my fix I've posted here PLUS you need to configure infinite-scroll with the correct parameters which are:

    content selector: .ngg-galleryoverview
    navigation selector: .ngg-navigation
    next selector: .ngg-navigation a.next
    item selector: .ngg-gallery-thumbnail-box

  5. Kewdo
    Posted 3 years ago #

    Hi thisismyalterego !

    And THANKS a lot for you post ! This is exactly what I was looking for. I'm using nextgen for a long time, and I tried to use infinite scroll with it, but with no luck... I'm trying to set things up like you said - still don't work at the moment.

    Anyway, thanks, because now I know it can work !

  6. Kewdo
    Posted 3 years ago #

    Actually, maybe you can help me : I've activated the plugin, changed everything for selectors, modified the .php file in the plugin directory, but nothing is showing up. I still have my classic page of ngg gallery, with pagination on the bottom.
    If I check the loaded files, can't find anything about infinite scroll...

    Am I missing something ?

  7. thisismyalterego
    Posted 3 years ago #

    Hi Kewdo,
    can you offer me a screenshot of the part of your code from the infinite-scroll.php file?

    Here is what my function there looks like:

    Do you have the latest version of NGG running?

    If there is no hint that anything from infinite-scroll is loaded at all there must be something wrong with that php file, not only the selectors. We will fix that - I'm sure. Just compare yours with mine or upload a screen here :)

    Oh and do you have a link to your page? Maybe I can have a look too

  8. Kewdo
    Posted 3 years ago #

    Thanks again for awnsering !

    Well, I originally changed the 'false' to true in this part of the code, but then I just paste the code you just gave me - same results.

    Nothing seems to be loaded at all on single pages, and I can't test on a 'post' page as far as I have none in my theme.

    Here's a link to a single page, with a gallery and several pages :

  9. thisismyalterego
    Posted 3 years ago #

    Hello again,
    I saw that there are some bugs on our page. We should get rid of them first.
    When looking in the console it says that the following files (which are included) can not be found:


    also some graphics are missing, but this shouldn't be a problem. But with missing js files… this might not so good.

    Oh, and do you have the latest version of ngg and infinite-scroll (from infinite-scroll.com) ?

  10. Kewdo
    Posted 3 years ago #

    I get rid of the two js files missing - indeed, i don't need them.

    For the graphic missing, white.gif, I don't know where the hell it's called. Seems to be in jquery, i'll look into it.

    Anyway: yes, I've updated nggallery, and downloaded the wordpress plugin from infinite-scroll.com.

  11. thisismyalterego
    Posted 3 years ago #

    alright. Maybe some other plugins are messing around?
    Can you try using another theme for testing? Because you are using something like jquery to load the content currently…  this could make it more difficult.

    I don't see any reason that infinitescroll isn't loaded at all, but maybe it's your theme.

    The only thing I also did - I don't know if it matters is, that I am using another permalinkstructure - when having get parameters submitted via url by using ?page= I've experienced some problems with infinite loop in the past, so I've changed that and I've also changed the permalink structure in nextgen-gallery plugin. There is an option for that . But this we can check out later.

  12. Kewdo
    Posted 3 years ago #

    Indeed with the default theme, it's working, loading more pages.
    So, there is a conflict with something in my theme : how to deal with it ?

  13. thisismyalterego
    Posted 3 years ago #

    Another idea would be to deactivate every other plugin first.

    I saw in your code you are using slimbox. Problem is that slimbox is including another jquery-latest library so there are 2 of them included in your code…

  14. thisismyalterego
    Posted 3 years ago #

    Is your theme written by yourself or is it a theme from the web (that got modified)

  15. Kewdo
    Posted 3 years ago #

    Well, I have not much plugins to deactivate... Because I'm using slimbox directly in the code.

    I'm going to try removing lines and testing one by one I guess ..!

  16. Kewdo
    Posted 3 years ago #

    And the theme is fully written by myself (sometimes using parts of code found somewhere else - but always trying to understand it)

  17. thisismyalterego
    Posted 3 years ago #

    Okay - I hope it works :)
    One problem *could* be that you are not using a "classic" url structure but loading code dynamically by using hash tags.

    Infinite scroll is "grabbing" the code from the second page by using the link that its selector has (a.next for example) - I'm not sure if a grabber can handle this well…

    Maybe I have some time over the weekend (not today sadly because I have a deadline) to look this up with one of my other pages (that are using hashtag-navigation too)

    I'll keep you posted

  18. Kewdo
    Posted 3 years ago #

    Yes - but like in the link I gave you, even when I'm directly on a single page (without loading content with ajax), it's not working.

    I've tried removing everything in my header - still don't work.

    I'll dig into it and keep you posted too !

  19. thisismyalterego
    Posted 3 years ago #

    Oh one important thing! Are you using a footer.php file?
    To me it seems that infinite scroll is not nested in the header, but in the footer!

    Here is what infinite-scroll creates in the footer of my page when looking into the code:

    You can have a look with another theme on your page how it is build there.
    Maybe you can force infinite scroll to post there stuff in your header - or you need a footer file.

  20. Kewdo
    Posted 3 years ago #

    I do have a footer file - this is where I had the two missing JS files earlier. Now it's empty - but still created.

  21. thisismyalterego
    Posted 3 years ago #

    okay and are you using
    <?php wp_footer(); ?>
    in your footerfile? This functions is doing all the magic with infinite scroll by looking up for external footer content (there is a footer.php in infinite scroll where the callback is written in )

  22. thisismyalterego
    Posted 3 years ago #

    well I was spying on your page - seems it works now :-)

  23. Kewdo
    Posted 3 years ago #

    Well - I did something that is maybe not clean :

    I ran the page with the twenty twelve default theme, selected all the js stuff added and pasted it into my footer - and oh ! it works.

    Maybe there is a way to make it cleaner - anyway, it's enought for now !

    Thanks a lot !

  24. Kewdo
    Posted 3 years ago #

    Hmmm I wasn't using <?php wp_footer(); ?>, going to try right away

  25. thisismyalterego
    Posted 3 years ago #

    yes :) I'm pretty sure you just need to add the wp_footer(); call to your footer.php as written above.

    Glad I could help. I had a bad time with the plugin the last 2 days so I know how you might felt

  26. Kewdo
    Posted 3 years ago #

    Hahaha, you were right ! <?php wp_footer(); ?> was the stupid little thing missing. You're a genius !

  27. thisismyalterego
    Posted 3 years ago #

    Oh - and you might have seen that the loading image is only showing one time, then its gone even if it's loading another bunch of images.

    Fix for that - add this to your cssfile:

  28. thisismyalterego
    Posted 3 years ago #

    Cool! Wish you all the best with your page and for your business

  29. Kewdo
    Posted 3 years ago #

    Now i'm having two more problems - heaven if I don't want to bother you any more.

    First is I want a manual trigger, but it's not showing when checked in the options. And it don't even scroll again, it's back to pagination.

    And second, the harder part will be to manage all this to work with ajax and my loaded content...

  30. Kewdo
    Posted 3 years ago #

    I'd love to discuss it with you - even this weekend if you prefer. You can contact me throught my website to avoid polluting this thread more than I already did !

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Infinite-Scroll
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic