Support » Plugin: NextGen Gallery Powertags » Title and lead text by tags – feature request

  • Resolved Epox



    First of all I would like to say a big thank You for your great work on this plugin. Powertags is the core of our children’s site.

    As We use it to display different “categories” of coloring pages – for example – I throught to give a little help to Google to find the filtered pages more interesting with adding the Tag’s -> name data before my page title. See my example here: where the “Nyuszi” is the first word of the page’s H1 title.

    I also trought, that I may use the NGG’s tags to display some additional description before the page content to let Google find some original, and related content to my pictures.
    Unfortunately there is no an NGG feature to set/write descriptions for tags, nor the “Rich Text Tags, Categories, and Taxonomies” plugin do it – even if it is listed in the official NGG extensions page.

    I would like to ask You – as the master of the NGG Tags – if You can add some functionality the Powertags to let us:
    – Modify the title of the page/post (containging the powertags shortcode) according to the actual tag
    – Add Tag Description editing
    – Add Tag Description display shortcode to your plugin (something like[nggpowertags tagdescription])

    Ok, I see that my request a little’ more than an usual feature request, and also see, that this is not a well designed developement route for You! 🙂

    But actually we are really working hardly dependent on NGG and Powertags, so my only chance to keep relatively clear my codes is to ask for some kind of extra function in Powertags.

    It could be a honor for me if I can assist in find a longterm way to handle the NGG tags with a little more SEO firendly viewport.

    Thanks for your kinde reply in ancipation,

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author sardbaba


    Hi Epox, sorry for the delay of the response.

    It’s a pleasure to have done a useful plugin, you are welcome. 😉

    Talking about your requests, I’m sorry but I can’t do what you tell me. Just the tag description with shortcode can be done but because of the plugin architecture (you can use more galleries, exclude/include more tags) I’m not sure if this could be a good idea.

    The other features (change post title accordingly to the actual tag, tag description) are really interesting but they are out of this plugin scope: it is more NextGen Gallery (the big one) request related (or another plugin that extends this feature).

    So, I’m sorry but this time I can’t be really useful :/


    Hi Sardbaba,

    Thanks for your kind reply. I see your point of view, and I’m really grateful for this super plugin. My request were in a situlation, when I were to search for possible solutions. I see that my request is a little more than it need to be.

    I’ll do my own solutions with a combination of theme customisation.
    Keep up your great work! 🙂

    Plugin Author sardbaba


    Thanks to you too for understanding.
    Please keep me updated if you find a solution, this can be also useful for the community.

    See you 🙂

    Hi Sardbaba,

    I’m near to be ready with my site’s functions. NGG+Powertags is the core part of my site, I have to use some kind of template customisation with combination of custom post types and taxonomies.

    I would like to ask for your help about how can I use the NGGpowertag’s image display function in my theme file to directly list the first 3 picture for a Tag.
    I woule like to acomplish the same in theme as I can do with NGGPT shortcode – except I would like to not display the tags list, and limit the number of images to 3.

    I wonder if you can help me to find the function to call. Thank you for your kind reply in ancipation!

    Plugin Author sardbaba


    Hi Epox,

    you can do something like that (adding it into your function.php file of your theme/subtheme):

     * Retrieve N pictures from a specific gallery with a specific tag.
     * @param mixed $galleryID
     *    The ID as int or string, or a list of gallery IDs as string.
     * @param string $term_slug
     *    The term in the specified gallery(ies).
     * @param int $num
     *    How many pictures should be shown.
     * @param string $template
     *    An optional NGG template.
     * @return string
     *    The pictures shown as HTML.
    function get_images_for_tag( $galleryID, $term_slug, $num = 1, $template = '' ) {
      global $wpdb;
      // Get term_id by term_slug.
      $term_id = $wpdb->get_col(
        "SELECT term_id FROM $wpdb->terms WHERE slug = '$term_slug'"
      // Retrieve all pictures ID(s) for this tag.
      $picids = get_objects_in_term($term_id, 'ngg_tag');
      // Retrieve the pictures objects from the ID(s).
      $pictures = nggpowertags_find_images_in_list($picids, true, 'ASC', $galleryID);
      // Get $num pictures.
      $picturelist = array_slice($pictures, 0, $num);
      // Create the gallery from the above selected pictures.
      return nggCreateGallery($picturelist, $gallery = false, $template);

    Then, into your theme pages:

    // Call the above function to print the images, where you want.
    echo get_images_for_tag( '7', "dubai", 3);

    Probably there are some errors to be handling, but this is just to have an idea on how it is possible to do some cool stuff 🙂


    Wow Sardbaba!

    Thank You very much for your kind efforts in help me to find the way. This is exactly what I were looking for. Can’t say more, that you did much-more than i hoped to help me complete our site’s functionality.
    I’ll go with that idea, finalize it in the site, and will post some site arthitecture details to give some idea for other users…

    Hi, The code was totally mistake free! 🙂

    Well it’s really tricky to make a good site architecture as a non-developer. My situlation is a little more complex, cause I use NGG+NGGPW as the core of the site, and I have WPML as a multilang system. My site ( is a children’s site, where they can find colorings, pictures, games, tales, videos, etc. Altrought the images are the focus with NGG and tagging.
    I have separated gelleries for coloring pages, and illustrations. I also have a section where are activity sheets, but this were done in multiple pages all are the children of an activity sheets page.

    I used to think about to set up the NGG Tags as an advanced Taxonomy by adding not just Name and Slug, but Description and Meta Title, Meta Description for good SEO. I couldnt find a solution for this. NGG have it’s own Tag management UI, and this is very limited, so I can not set more for a Picture Tag, than Name and Slug.

    Additionally I used to try to get total SEO friendly URLs, like /coloring-pages/easter/ with no success.

    My goal were to make some SEO friendly URLs, where I can display content related to a term. My primary terms should be holiday names, like Christmas, Easter, MothersDay etc.

    My final solution were to make a custom taxonomy (Types plugin free) and link it to every kind of content except the NGG pictures. By this term I have now a friendly url(/unnepek/husvet / in english =holidays/easter), where can list term related: pages, posts, custom-post-types. This is a simple copy of the archive.php renamed to taxonomy-holidays.php. This is customized to show pages, and just after every page listed shows posts. Also this have the above custom function to display 3 images form the coloring pages and 3 images from the illustrations gallery.

    Plugin Author sardbaba


    Hi again Epox,

    you are welcome, I’m glad you finished the construction of the site 🙂

    Thank you so much for the detailed illustration on how you have setup the site: it will be surely useful for non-developers.

    About the “SEO friendly URLs”, I think you forgot to do something, because I got it working and I described the procedure in a recent thread: and also in the main plugin page, under the Permalinks section.

    Anyway the site is out and it is good for other people to know that there is more than one way to accomplish the same result.

    Keep in mind that as a freelance developer I can work remotly: if you need help for some works you are doing, just contact me to my mail address, describe the type of help and I’ll make a quotation.


    Hi Sardbaba,

    I used to give the friendly tags a try based on your description. Unfortunately without success.
    Now I searched for some other descriptions, like this:
    I followed all the steps, and ended up with the same result: the tags are still in ?gallerytag=baba format.
    I also saw your demo site where the tags have the same non-SEO friendly urls.

    Do You have a working examle for this functionality? I can not manage to make it work. 🙁

    I’ll keep your offer in my mind if our site will perform well enough to have the ability to pay for custom coding, and if any of my clinets will have a WP custom coding project.

    Plugin Author sardbaba


    Hi Epox,

    I also saw your demo site where the tags have the same non-SEO friendly urls.

    You are right, I forgot to enable it, now it works 🙂

    To correctly enable the permalinks on NGG you have to be sure that you have:

    1. Enabled the permalinks in WordPress at yoursite/wp-admin/options-permalink.php (I’m using /%postname%/)
    2. Checked your .htaccess file (
    3. Checked the virtual host settings (
    4. Enabled the permalinks on NextGen Gallery (as described in the main plugin page, or in the thread I’ve linked above or in the link you posted above)

    I’m pretty sure that one of the previous is not set up correctly, almost certainly the virtual host.

    Hi Sardbaba,

    1. Done it (I’m using /%category%/%postname%/).
    2. Checked my .htaccess file, it have the standard WP rewrite rules in it.
    3. Checked the virtual host settings: in Hostgator the default is the AllowOveride All.
    4. Also done it.

    Additionally I have friendly links in all the site except in Nextgen gallery (look at I think that something other problem causeing this, maybe that I not using the /%postname%/ permalink, but with category prefix dir.

    I’ll get back if have any success with the setup…

    I’ve also tested with the /%postname%/ permalink, but with no success.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Title and lead text by tags – feature request’ is closed to new replies.