WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Nextgen-Gallery] - Showing only one thumbnail but no pagination (6 posts)

  1. Soundofsirens
    Member
    Posted 6 years ago #

    Hi There.

    Is there any workaround to make the ngg showing only 1 thumbnail but not seperating the gallery into multiple pages?
    I'd like to show the first thumbnail only, but inside the thickbox there should be next and prev buttons to skip through the whole gallery.

    Tried to reduce the number of thumbs via the admin interface, but then the pagination appears (which should easily be killed by css) BUT the're is no prev/next at the the thickbox.

    Any ideas?
    Help would be great! :)

  2. Soundofsirens
    Member
    Posted 6 years ago #

    OK. I found a quick and dirty solution! :)

    in nggfunctions.php
    add $i = 1; to line 330 before foreach ($picturelist as $picture) {

    Then go to line 346 and add id="unique' . $i++ . '" to the div ngg-gallery-thumbnail.

    This outputs <div id="unique1" class="ngg-gallery-thumbnail"...><div id="unique2" class="ngg-gallery-thumbnail"...><div id="unique3" class="ngg-gallery-thumbnail"...> ans so one.

    Now switch to your theme's css-file and add following lines:
    .ngg-gallery-thumbnail {display:none; height:0px;}
    #unique1 {display:block; height:your thumbnail height in px;}

    et voila! :D

  3. Alex Rabe
    Member
    Posted 6 years ago #

    Yes that did the trick, but it increase the loading time

  4. Soundofsirens
    Member
    Posted 6 years ago #

    don't think so. it only hides all thumbs except the first one...
    (and as i mentioned before: "quick and dirty" - i know)

    ;)

  5. alkafy
    Member
    Posted 5 years ago #

    I took a different approach here -

    I set Options -> Gallery -> "Number of images per page" to 1, then commented out line 312 in nggfunctions.php like so:

    //$navigation = nggallery::create_navigation($page, $total, $maxElement);)

    In this way, only 1 thumbnail loads.

    Edit: Should have read more carefully, I didn't realize you still wanted the thickbox to page. I'll look into this for a way to do it without hiding thumbnails.

  6. digimon
    Member
    Posted 5 years ago #

    Soundsofsiren,

    Can you cut and paste excerpts of your code becase I did not exactly know what you mean by:
    Then go to line 346 and add id="unique' . $i++ . '" to the div ngg-gallery-thumbnail.

    Also, where on the theme css file should I add the following lines:
    .ngg-gallery-thumbnail {display:none; height:0px;}
    #unique1 {display:block; height:your thumbnail height in px;}

    Thanks for your help. I have been trying to figure this out for a long time.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.