Im using the Nextgen sidebar widget and wonder if its possible to link the images back to the image page instead of a direct link to the image?
Im using the Nextgen sidebar widget and wonder if its possible to link the images back to the image page instead of a direct link to the image?
I don't know of a way to this with a widget. And getting NextGen to link to an post or page rather than the images is a bit of work. You need to use the NextGen Custom Fields plugin and tweak the NextGen plugins.
I wrote two articles about this
Have you tried this widget?
http://wordpress.org/extend/plugins/nextgen-gallery-sidebar-widget/
I'm using it and does the job after you define a page link in the gallery settings. Actually you can define a default page for all thumbnails.
Hello, I too am trying to figure out a way to get the widget images to link to their corresponding image page.
I think it's a little odd how this isn't provided as a standard option.
The Custom Fields workaround might work, but having to input a link on each image seems rather static and laborious, unless there's a way to add the link dynamically..?
The other widget plugin, the Sidebar Widget, is good for listing galleries, but I don't see a way to replicate the random and recent images that the original widget outputs.
Any more ideas anyone?
Right, I've been tearing my hair out, and have come up with a solution (and am now bald).
I installed the Custom Fields plugin, and entered a Link attribute to each and every image to tell it what album/gallery it was in.
I then hacked the nextgen-gallery/widgets/widgets.php page a little, replacing $image->imageURL in the anchor tag href for the following on line 319:
$out = 'pid, "Link") . '?pid='.$image->pid . '" title="' . $description . '" ' . $thumbcode .'>';
That seemed to do the trick.
I also edited nextgen-gallery/view/singlepic.php to link to the image page, by replacing line 22 with this:
Soooo hopefully there should be no links directly to the image now.
If there are please let me know, as image theft is rife on the web, so I wouldn't want to make it easier for folk to nick my work.
Enought prattle now. Bye!
If it is a static page there is a pretty easy fix.
Open up /nextgen-gallery/widgets/widgets.php.
Edit the line (currently 322) that says
//TODO:For mixed portrait/landscape it's better to use only the height setting, if widht is 0 or vice versa
$out = '<a href="' . $image->imageURL . '" title="' . $description . '" ' . $thumbcode .'>';
And replace the $image->imageURL with your URL (in quotes).
So it becomes
'<a href="' . 'YOUR URL HERE'. '" title="' . $description . '" ' . $thumbcode .'>';
This topic has been closed to new replies.