treehouse : what would you like to learn today?
Web Design Web Development iOS Development

WP NextGEN Gallery - is this possible?

  • I've got a question for a friend of mine who I'm setting up a little wordpress site for their artwork portfolio. The problem is that she wants to have certain paintings show "sold" under the thumbnail image.

    This is beginning to be a problem because some of the painting titles can get quite long. One of the short code examples allows you to use "template=caption", which shows the image Description under the image thumbnail.

    One solution I thought of is if perhaps we can have the tags show up under the thumbnail instead of the description. Then I could have the description show up and create a tag of SOLD. Does that sound viable? Is there some easy solution I could be missing?

    Thanks in advance!
  • Just FYI in case anyone needed to do the same, here's what I did to make it work:

    Install the NextGEN custom fields plugin to accompany the gallery, and I created a new custom field called "SOLD" that now shows up on the backend under your gallery images.

    Based on a few resources I created a custom entry in the plugins/nextgen/views/gallery.php file that look like this:

    <?php echo $image->ngg_custom_fields["Your Field Name Here"]; ?>

    Right under the thumbnail. I ended up making a div that sits on the bottom left of the image, otherwise itwas messing up the float.

    All said and done it looked like this:



    <div class="ngg-gallery-thumbnail" >

    <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >


    <?php if ( !$image->hidden ) { ?>

    <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />

    <?php } ?>

    </a>
    <!-- Custom SOLD message -->
    <div class="sold_field"><?php echo $image->ngg_custom_fields["Sold"]; ?></div>
    <!-- End Custom SOLD message -->
    </div>


    So now it displays on the bottom left of the image if you put Sold in that custom field on your gallery.