• johnnyvus

    (@johnnyvus)


    Hi All,

    I was wondering if there is anyway to center thumbnails in a gallery. Right now it looks like only justified-left is available.

    I’d like both vertical and horzontal thumbnails to center for each column. On this page there are two horozontal thumbs that are off center.

    https://ritamadison.com/?page_id=35

    Any ideas on how to fix this?

    Many Thanks,

    John V.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter johnnyvus

    (@johnnyvus)

    So does anyone have any ideas?

    Thanks,

    John

    monodistortion

    (@monodistortion)

    It’s a little tricky since the thumbnails are just sitting in divs and each div has no relation to the div below it. I started thinking about it and thought it could probably be done with a custom template that generated a table holding the divs.

    Here’s the page describing custom templates:
    https://nextgen.boelinger.com/templates/

    Here’s the code I came up with:

    <!-- Thumbnails -->
    	<table>
    		<tr>
    <?php foreach ($images as $image) : ?>
    			<td align="center">
    				<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box">
    					<div class="ngg-gallery-thumbnail" >
    						<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
    							<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    						</a>
    					</div>
    				</div>
    			</td>
    <?php if ( ($gallery->columns > 0) && (++$i % $gallery->columns == 0) && ( $i < count($images)) ) { ?>
    		</tr>
    		<tr>
    <?php } ?>
    <?php endforeach; ?>
    		</tr>
    	</table>
    
    	<!-- Pagination -->

    You’ll need to modify the CSS some to get each div to sit in the center of each td.

    Thread Starter johnnyvus

    (@johnnyvus)

    Thanks monoD! I’ll be testing your code in a couple days.

    Many thanks,

    John

    Anonymous User 4104441

    (@anonymized-4104441)

    yeah, table is the easiest solution here :((

    double post/ see below

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: NextGEN Gallery] Anyway to Center Thumbnails in Columns?’ is closed to new replies.