WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] Related Image option... (6 posts)

  1. Jim R
    Member
    Posted 4 years ago #

    I have hard coded if (function_exists("the_related_images")) the_related_images($type = 'tags',$maxNumbers = 9); on my Tag Archive page of my theme. It's not providing images relative to the specific tag.

    In one case it is, but in another it's definitely not. The instance it is working, I tagged the photos in the NextGen manage gallery area. The instance it isn't, I tagged the photos in Picasa 3 as I edited them. As I imported them to their gallery (a different gallery), it carried the tags with them so the tags show up in the gallery admin page.

  2. Jim R
    Member
    Posted 4 years ago #

    Tested it in a php code widget. It didn't work there either.

  3. Alex Rabe
    Member
    Posted 4 years ago #

    Not sure if the tags are imported from Picasa, but the idea is follow :

    You have a post content and you add to the post the tag "fish", then this function show up a images which have the same tag. Not sure if this will work on the Tag Archive page, but on post's should it work.

  4. Jim R
    Member
    Posted 4 years ago #

    It appears to be working on Posts, and the tags show up in the Manage Gallery admin section. I can't seem to locate where NextGen stores its tags in the database though.

    The NextGen plugin homepage showed a snippet of code so it could be used elsewhere, which I assume to mean on a Single.php, which is what Posts are shown on. I'd like to use that code on my theme's Tag.php (Tag archive page).

    On my Tag.php I have included code from another PHP page which gets information about about that Tag from a data table that I created and maintain. (Information about basketball players.) So I'm able to carry the tagID from WordPress to that page. I'm hoping to be able to match that with the tag information from my images, which would produce related images the same way as they do on Posts.

    Here is an example of what I'm talking about:

    http://hoosierhoopsreport.com/tag/justin-gant/

    Everything from RECENT ARTICLES and above are from my custom code. I have a var_dump in there too, which reflects the WordPress tagID, in this case "72". I assumed the Tag information would match the same way as it does on Posts, but I guess it doesn't.

    Any thoughts?

  5. Alex Rabe
    Member
    Posted 4 years ago #

    Tags are stored in the taxonomy tables of wp.

    The function the_related_images() should be only used inside the loop, becaus it look for post tags with get_the_tags(). See here

    http://codex.wordpress.org/Function_Reference/get_the_tags

  6. Jim R
    Member
    Posted 4 years ago #

    So in my case for example, term_id 68 has eight post_tags and 41 ngg_tags. How would I go about pulling the images with matching term_id, echo'ing the photos with the applicable ngg_tags?

    I would need to echo the images with the ngg_tag that has the matching term_id as the term_id for that Tag Archive page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.