Support » Plugin: NextGEN Custom Fields » [Plugin: NextGEN Custom Fields] WordPress 3.3 broke Nextgen gallery image links

  • Resolved od_sf


    I have a Nextgen image gallery configured with a NGG custom “link” field so that when you click on an image in the gallery, it takes you to a different page on the site. Everything was working perfectly until i upgraded to wordpress 3.3 today. Now, when you click on an image in the gallery, it takes you to the larger version of the image located in /wp-content/gallery/ instead of the URL located in the “link” field.

    URL in question:



Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author shauno


    I haven’t actually tested it with WP 3.3 yet, as it more relies on NGG than WP.
    Did you also update NGG? When you update NGG, the template files you needed to edit get overwritten. You need to make the change again. If you want, you can move them to your themes directory from now on. That will stop them getting updated.

    Let me know if you have still got the changes in your template files, and I can have a look further when I get some time

    Thanks for the response shauno. Honestly don’t remember if I updated NGG or not today. I might have.

    I’m really confused because in “manage gallery” all my links are still showing up (see link for screenshot below) so i don’t know what changes i need to make again.

    Any additional help greatly appreciated.

    Plugin Author shauno


    The links will be there. It’s the template that shows the images (and outputs the <a> links that will have been overwritten.

    Here is the original thread where the concept was introduced and discussed:


    again, thanks for the help. I think we’re almost there….

    I edited gallery.php as indicted and replaced

    imageURL ?>” title=”<?php echo $image->description ?>” <?php echo $image->thumbcode ?> >


    ngg_custom_fields[“releases”]; ?>” title=”<?php echo $image->description ?>” <?php echo $image->thumbcode ?> >

    (i called my custom field releases.)

    It still however won’t link to the URLs entered in the custom links fields, it just links right back to the default page.

    I might have taken a stupid pill this morning, so any additional help would be much appreciated. I’m sure it’s something super-simple but my brain isn’t working well today. 🙂


    re-posting, I edited gallery.php as indicted and replaced

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


    <a href="<?php echo $image->ngg_custom_fields["releases"]; ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >

    Never mind, fixed. again, my brain isnt working correctly today. Thank you so much for the help and the useful plugin!



    Plugin Author shauno


    Glad you got it sorted. As I said earlier, you can move the NGG templates to your theme to stop them being overwritten by another update.

    [ Signature moderated. ]

    I want to post an FYI for those of you running the Mazine Theme – it’s integrated differently with NGG and the hack that’s been working for folks here, doesn’t work with that theme. Very frustrating. Somone who knows a lot of PHP might be able to get it working but I wasn’t. It turns out that Mazine is not using the gallery.php page, but on inside the admin folder in the theme called tiadmin.php.

    Plugin Author shauno


    Hey sock2me

    If you can get the image ID, you can still get the custom field value by calling <?php echo nggcf_get_field($pid, "Custom Field Name Here"); ?>.

    Hope that helps!

    [ Signature moderated. ]

    Shauno – I believe I’ve found the place where I’d need to make the modification – but I’m not sure what exactly I’d need to do. Can you assist? The code is below:

    foreach($gal as $item){
    picture = nggdb::find_image($item->pid);
    $html .= ‘
    <li class=”‘.implode(‘ ‘, wp_get_object_terms($item->pid, ‘ngg_tag’, ‘fields=names’)).'” data-id=”‘.$elid.'”>

    <div class=”ic_container”>alttext)).'” rel=”group” href=”‘.$picture->imageURL.'”><img src=”‘.$picture->thumbURL.'” alt=”Hello World” />
    <div class=”ic_caption”>
    <p class=”ic_text”>’.$item->description.'</p>

    Thank you

    Plugin Author shauno


    That code has come through a little broken. Please paste it in code tags (backticks)

    Thank you Shauno,
    [Code moderated as per the Forum Rules. Please use the pastebin]

    I’ve also put it here in case this didn’t come through properly. Thanks again!

    Plugin Author shauno


    You need to add the call to nggcf_get_field().

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Replace YOUR CUSTOM FIELD NAME HERE with the name of your custom field.

    [link removed]

    Just in case someone else ever uses Mazine theme with this plugin, here’s how I solved it: (with a lot of help from shauno!)

    <li class="'.implode(' ', wp_get_object_terms($item->pid, 'ngg_tag', 'fields=names')).'" data-id="'.$elid.'">
    							<div class="gallery_series"><a title="'.stripslashes(nggGallery::i18n($item->alttext)).'" rel="group" href="'.nggcf_get_field($item->pid, 'custom link').'"><img src="'.$picture->thumbURL.'" alt="Hello World"/></a></div></li>';

    The custom field guy has to go into the href as above (my field name is ‘custom link’). If you simply put that guy in a paragraph tag like shauno’s sample it just shows up below the image. I also had to replace the class that was connected to the javascript file running the effect – I replaced it with ‘gallery_series’ and gave it the styles it needed for my layout.

    Hope this helps someone someday. Thanks again Shauno!

    Shauno! First, great plugin! I have custom links and photo titles on some of my nextgen photos and it works great. When you click the photo it takes you to the linked url etc.

    However, it has prevented my other photos from being able to enlarge or do anything but sit there as thumbnails. When you clicks the thumbnails they just refresh the page. Is tehre a hack that lets the custom fields only work on the galleries they’re assigned to and not make any ther difference to the rest of the photos?


Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: NextGEN Custom Fields] WordPress 3.3 broke Nextgen gallery image links’ is closed to new replies.