WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] pagination? (9 posts)

  1. jsylvia90
    Member
    Posted 1 year ago #

    Hi,
    Install is NextGEN Gallery by Photocrati Version 2.0.40

    I have updated the pagination on several previous versions on different sites (in the gallery.php file without issue). Typically simple to do.

    With this new site it took me awhile to find the gallery.php but I finally found it here:

    wordpress/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view

    I made the simple edit of adding the pagination code (copied kept the bottom) above the thumbnail code:

    <!-- Pagination -->
    <?php echo $pagination ?>

    <!-- Thumbnails -->
    <?php $i = 0; ?>
    <?php foreach ( $images as $image ) : ?>

    ...

    I've never had a problem before but for this site it just doesn't show on top. I did some other tests and I think I may not be looking in the right directory or perhaps editing the wrong gallery.php file. I did refresh and clear caches and it is just not updating with what I've done. (Deleted files too, so I suspect something is somewhere else, but I've searched for hours.)

    This site is brand new in beta with all the latest WordPress has to offer.

    I just need the pagination to show above as well as below the thumbnails and it used to be so easy. I'm sure its something simple that I'm doing wrong. Any suggestions?

    It used to be so easy.
    Thanks!
    JS

    https://wordpress.org/plugins/nextgen-gallery/

  2. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    @jsylvia90 - We recently discovered there was an issue withe $pagination variable not being populated with the expected data causing issues with custom templates.

    The corrections for this issue should be in our latest beta version, please see this page for more details: http://www.nextgen-gallery.com/nextgen-gallery-latest-beta/

    Thanks!

    - Cais.

  3. jsylvia90
    Member
    Posted 1 year ago #

    So I'm not going crazy!... Thanks. I will check it out. :)

  4. jsylvia90
    Member
    Posted 1 year ago #

    Hi and thanks for your input.

    I did the update now shows NextGen version Version 2.0.55. All seems okay as far as function of the gallery (whew), but it still doesn't show the navigation on the top. So still somewhat stumped, but I still wonder if maybe I'm editing the wrong file (when I delete the gallery.php it still works AND I did clear my cache. I don't have any other NextGen extensions either.

    I'm editing the gallery.php file here:

    /1029/public_html/vote_gina_derossi/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view

    Here is a copy of the gallery.php code:

    <?php
    /**
    Template Page for the gallery overview

    Follow variables are useable :

    $gallery : Contain all about the gallery
    $images : Contain all images, path, title
    $pagination : Contain the pagination content

    You can check the content when you insert the tag <?php var_dump($variable) ?>
    If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
    **/
    ?>
    <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>

    <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">

    <?php if ($gallery->show_slideshow) { ?>
    <!-- Slideshow link -->
    <div class="slideshowlink">
    slideshow_link) ?>">
    <?php echo $gallery->slideshow_link_text ?>

    </div>
    <?php } ?>

    <?php if ($gallery->show_piclens) { ?>
    <!-- Piclense link -->
    <div class="piclenselink">
    piclens_link) ?>">
    <?php _e('[View with PicLens]','nggallery'); ?>

    </div>
    <?php } ?>

    <!-- Pagination -->
    <?php echo $pagination ?>

    <!-- Thumbnails -->
    <?php $i = 0; ?>
    <?php foreach ( $images as $image ) : ?>

    <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    <div class="ngg-gallery-thumbnail" >
    imageURL) ?>"
    title="<?php echo esc_attr($image->description) ?>"
    data-src="<?php echo nextgen_esc_url($image->imageURL); ?>"
    data-thumbnail="<?php echo nextgen_esc_url($image->thumbnailURL); ?>"
    data-image-id="<?php echo esc_attr($image->pid); ?>"
    data-title="<?php echo esc_attr($image->alttext); ?>"
    data-description="<?php echo esc_attr($image->description); ?>"
    <?php echo $image->thumbcode ?> >
    <?php if ( !$image->hidden ) { ?>
    <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> />
    <?php } ?>

    </div>
    </div>

    <?php if ( $image->hidden ) continue; ?>
    <?php if ($gallery->columns > 0): ?>
    <?php if ((($i + 1) % $gallery->columns) == 0 ): ?>
    <br style="clear: both" />
    <?php endif; ?>
    <?php endif; ?>
    <?php $i++; ?>

    <?php endforeach; ?>

    <!-- Pagination -->
    <?php echo $pagination ?>

    </div>

    <?php endif; ?>

    ************

    Thanks again, its still a great plugin and would be greater if I could get it like my others with the nav on the top too.

    JS

  5. tizz
    Member
    Posted 1 year ago #

    @jsylvia90 You are still able to edit your post, so wrap your code between "code" tag or use a service like pastebin

  6. jsylvia90
    Member
    Posted 1 year ago #

    Woops! Not letting me edit, so let me try your suggestion here:

    and here:

    <?php
    /**
    Template Page for the gallery overview
    
    Follow variables are useable :
    
    	$gallery     : Contain all about the gallery
    	$images      : Contain all images, path, title
    	$pagination  : Contain the pagination content
    
     You can check the content when you insert the tag <?php var_dump($variable) ?>
     If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
    **/
    ?>
    <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
    
    <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
    
    <?php if ($gallery->show_slideshow) { ?>
    	<!-- Slideshow link -->
    	<div class="slideshowlink">
    		<a class="slideshowlink" href="<?php echo nextgen_esc_url($gallery->slideshow_link) ?>">
    			<?php echo $gallery->slideshow_link_text ?>
    		</a>
    	</div>
    <?php } ?>
    
    <?php if ($gallery->show_piclens) { ?>
    	<!-- Piclense link -->
    	<div class="piclenselink">
    		<a class="piclenselink" href="<?php echo nextgen_esc_url($gallery->piclens_link) ?>">
    			<?php _e('[View with PicLens]','nggallery'); ?>
    		</a>
    	</div>
    <?php } ?>
    
    	<!-- Pagination -->
     	<?php echo $pagination ?>
    
    	<!-- Thumbnails -->
        <?php $i = 0; ?>
    	<?php foreach ( $images as $image ) : ?>
    
    	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    		<div class="ngg-gallery-thumbnail" >
    			<a href="<?php echo nextgen_esc_url($image->imageURL) ?>"
                   title="<?php echo esc_attr($image->description) ?>"
                   data-src="<?php echo nextgen_esc_url($image->imageURL); ?>"
                   data-thumbnail="<?php echo nextgen_esc_url($image->thumbnailURL); ?>"
                   data-image-id="<?php echo esc_attr($image->pid); ?>"
                   data-title="<?php echo esc_attr($image->alttext); ?>"
                   data-description="<?php echo esc_attr($image->description); ?>"
                   <?php echo $image->thumbcode ?> >
    				<?php if ( !$image->hidden ) { ?>
    				<img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> />
    				<?php } ?>
    			</a>
    		</div>
    	</div>
    
        <?php if ( $image->hidden ) continue; ?>
        <?php if ($gallery->columns > 0): ?>
            <?php if ((($i + 1) % $gallery->columns) == 0 ): ?>
                <br style="clear: both" />
            <?php endif; ?>
        <?php endif; ?>
        <?php $i++; ?>
    
     	<?php endforeach; ?>
    
    	<!-- Pagination -->
     	<?php echo $pagination ?>
    
    </div>
    
    <?php endif; ?>

  7. jsylvia90
    Member
    Posted 1 year ago #

    Sorry, I don't post often and don't know all the nuances yet...

    Anyway the above pasted code is in the gallery.php file that I found. the directory path is /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view

    However the very weird part is that after I uploaded the above edited file and it didn't work I tested by deleting it from the remote host server... strangely the gallery still seemed to work fine... this leads me to believe I may be editing the wrong file, but for the life of me I can't find anything else. Beta update didn't resolve either.

    Thanks for your note!
    JS

  8. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    @jsylvia90 - You still have to select that template, even the "gallery" one as it is not used by default.

    Thanks!

    - Cais.

  9. jsylvia90
    Member
    Posted 1 year ago #

    Thanks... that was it!! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic