• Resolved girathryn

    (@girathryn)


    Hello! Would appreciate help with the following. I am running WordPress 3.5.1 and NextGEN 1.9.11, theme Twenty Eleven.

    Okay, normally, an album would display “X photos” in extended view, but only if it was full of galleries. An album that contained more albums (like sub-albums) wouldn’t display anything, which was fine.

    Now, after the update, I have one album full of sub-albums and now it says “4 photos” where before it used to say nothing. The 4 is actually referring to the number of galleries within the sub-album, not the number of photos (there are around 80 photos in all).

    Here is a link to the page with the issue:

    https://www.thealternativebride.com/photo-gallery/

    Thanks very much for this great plugin. Any help would really be appreciated. Ideally, the album would say “4 galleries” or nothing at all, since “4 photos” is inaccurate.

    Anyone else having this issue? Sorry if I’m not being very clear – it’s kind of hard to explain!

    https://www.ads-software.com/extend/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Same issue since 1.9.11. NextGEN displays the number of sub albums instead of the total number of photos. So if an album has 2 sub albums with 5 and 6 photos, it will display “2 Photos” instead of “11 Photos”.
    I went back to the previous behaviour (no display of the # of Photos) by removing the following lines

    <?php if ($gallery->counter > 0) : ?>
    <p><strong><?php echo $gallery->counter ?></strong> <?php _e('Photos', 'nggallery') ?></p>
    <?php endif; ?>

    (lines 31 to 33) in the file album-compact.php

    Cheers

    Here is our solution for showing # photos, or # galleries for sub-albums.

    If gallery or sub-album is empty, it shows 0 photos or 0 galleries. If the count is singular, it shows 1 photo or 1 gallery.

    Change the following code in album-compact.php (or album-extend.php). To avoid having your changes overwritten when upgrading Nextgen, copy /wp-content/plugins/nextgen-gallery/view/album-compact.php to a sub-folder /nggallery/ under your theme (i.e. /wp-content/themes/twentyeleven/nggallery/album-compact.php) and edit the copy.

    Old code:

    <?php if ($gallery->counter > 0) : ?>
    <p><strong><?php echo $gallery->counter ?></strong> <?php _e('Photos', 'nggallery') ?></p>
    <?php endif; ?>

    New code:

    <p><strong><?php echo $gallery->counter ?></strong> <?php if ( $gallery->gid ) {
    	if ( $gallery->counter == 1 ) {
    		_e('Photo', 'nggallery');
    	} else {
    		_e('Photos', 'nggallery');
    	}
    } else {
    	if ( $gallery->counter == 1 ) {
    		_e('Gallery', 'nggallery');
    	} else {
    		_e('Galleries', 'nggallery');
    	}
    } ?></p>

    Using Nextgen version 1.9.12 and WordPress 3.5.1

    Thread Starter girathryn

    (@girathryn)

    I know it’s been a long time, but thank you for this fix! It works!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Album of Galleries Extended View Showing Wrong After Update’ is closed to new replies.