Activating Custom Fields
-
A few years back, I started using the NextGen Custom Fields plugin to add a few effects to my gallery. Specifically, I added custom fields for the URL that the user is taken to when the click on an image, and the alt text that appears when they hover over the image.
After adding these custom fields via the plugin, and adding the appropriate values in my Gallery Manager for each of these fields, I then had to tweak my code in the gallery-caption.php file in order to make these custom fields activate.
Because I was changing this core php file, I had to save a copy of it and manually re-upload it every time I updated this plugin, because the plugin update would always overwrite this very crucial code — which I had very little understanding of, as I merely copied and pasted it from these help forums.
Lo and behold, I somehow lost that crucial gallery-caption.php file, and now none of my custom fields are being applied in my galleries (like this one, for example).
Can someone please help me restructure my gallery-caption.php code to make these URLs, captions, and alt text active again?
I know that the section of the code I had to replace looked something like what I’m going to paste below, but it must be a little bit off somewhere because when I upload that to my site, it’s not making anything display on my gallery.
<!– 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” >
ngg_custom_fields[“URL”]; ?>”
title=”<?php echo $image->description ?>”
<?php echo $image->thumbcode ?> >
<img title=”<?php echo $image->ngg_custom_fields[“Tagline”]; ?>”
alt=”<?php echo $image->alttext ?>” src=”<?php echo $image->
thumbnailURL ?>”
<?php echo $image->size ?> />ngg_custom_fields[“URL”]; ?>”>
<?php echo $image->alttext ?>
</div>
The topic ‘Activating Custom Fields’ is closed to new replies.