WordPress.org

Support

Support » Plugins and Hacks » [Plugin: NextGEN Gallery] Sidebar Widget – How to link page page anot not the image

[Plugin: NextGEN Gallery] Sidebar Widget – How to link page page anot not the image

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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

    How to Link NextGEN Gallery Images to an Individual Page or Post in WordPress

    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:

    ngg_custom_fields[“Link”] . ‘?pid=’.$image->pid ?>” title=”<?php echo $image->linktitle ?>” <?php echo $image->thumbcode ?> >

    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 .'>';

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: NextGEN Gallery] Sidebar Widget – How to link page page anot not the image’ is closed to new replies.
Skip to toolbar