Support » Plugins and Hacks » Nextgen gallery display tags below images

  • johnpaulvaughan

    (@johnpaulvaughan)


    I think I’ll kick myself as It’s driving me insane…. is there an easy way to get the tags for an image in Nextgen Gallery, such as picture->tags ?

    1. I get my picture array ($pictures = $wpdb->get_results(“SELECT t.*, tt.* FROM $wpdb->nggallery AS t INNER JOIN $wpdb->nggpictures AS tt ON t.gid = tt.galleryid “);)

    2. then can pull all my other info (eg.
    $imageID = $picture->pid;
    $galleryID = $picture->galleryid;

    but then I’m stuck… the tags don’t seem to have an easy reference.

    I stumbled across this but it doesn’t seem to work.
    $picture_tags = $nggTags->get_tags_from_image($imageID);
    echo $picture_tags;

    any help would be appreciated.

    Thanks
    JP

Viewing 2 replies - 1 through 2 (of 2 total)
  • roberthq

    (@roberthqprintsnet)

    I need the same thing. You can try this

    http://www.soulrinse.com/soulblog/how-to-create-a-nextgen-gallery-tag-cloud/

    But I can’t make it work.

    I found a way to do this and since I couldn’t find it anywhere else I thought I post it here, even though this question where asked a few month ago:

    <?php $tags = wp_get_object_terms($image->pid,'ngg_tag') ?>
    
    <?php foreach ( $tags as $tag ) : ?>
       <a href="<?php bloginfo('url'); ?>/tag/<?php echo $tag->slug; ?>"><?php echo $tag->name; ?></a>
    <?php endforeach; ?>

    (This just prints the tags as links to http://example.com/tag/example-tag, I guess that the links won’t work but you get the point :D)

    This would be added in your ngg gallery template, inside the loop for printing out the images.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nextgen gallery display tags below images’ is closed to new replies.