How To Add Custom Fields In NextGEN Gallery To Give Link On Images Of Posts Or Page

Hello Friends, yesterday I was working with best WordPress gallery NEXT GEN Gallery in one project. Next Gen Gallery is the best wordpress gallery.It is having so many features and also it is very easy to customize.NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a Flash slideshow option.Thought It has so many options in it, I want to integrate it in sidebar and then want link on each picture for particular post, In short I want one more custom field for images uploded in gallery. So below is the steps by which you can add link for every image.
1. Install Next Gen Gallery Plugin.
2. Upload images.
3. Go to Gallery > Options > Effects > Set Javascript Thumbnail Effect to ‘None’.
4. Now install NextGEN Custom Fields Plugin.
5. Go To Main menu ‘NGG Custom Fields’ > Setup Fields.
6. Click on ‘Image Custom Fields’ to create custom fields for image.
7. Add custom field by giving display name and selecting input type as text input(I want text box as input for link, So i select text input as type).
8. Go to Manage gallery and click on one gallery,You will find this added custom field for every image.
9. Now enter value of that text box for every image and click on save changes.
10. Go to Plugins > Editor > Switch to NextGEN Gallery in the Drop down Box > and click on nextgen-gallery/view/gallery.php It is near the bottom of the lists(Take backup before modifying this file.).
11. Replace following code starting from line number 41

<div >
<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>
</div>


12. With this one

<div class="ngg-gallery-thumbnail" ><a href="<?php echo $image->ngg_custom_fields["img_url"]; ?>" 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>

13. Dont forget to change custom field name you have created. In my case My custom field which i have created is ‘img_url‘ So just replace your custom field name with your custom field name.
14. We have changed core file of plugin so whenever we upgrade this plugin, these changes will be lost.