Support » Plugin: Yet Another Related Posts Plugin (YARPP) » [Plugin: Yet Another Related Posts Plugin] Finding related images

  • Resolved Luke Gedeon


    I have an interesting problem, and wondered if you had any insight on how to attack it.

    I have a bunch of tagged images, and a whole bunch of posts coming in. As each post comes in, I would like to pair the post with a related image based on the content of the post and the tags on the images.

    I started using and loved YARPP many years ago, and immediately thought of it when this problem came up. I was wondering if you had any insight on how to make sure I get a good match.

    My thinking so far is to toss out low value words (the, a, an, and, of, etc.) then go through the rest of the words and find which ones match tags I have used, but that does not seem like it would give the best match. I would need some way of measuring relevance.

    I also have the possibility of the image being tagged “trees” and the post mentioning forest, but I can just tag better, unless there is a dictionary I can work against to make these associations.

    I will be grateful for any related code to learn from, other suggested reading, or general thoughts you can provide.

Viewing 5 replies - 1 through 5 (of 5 total)
  • It sounds like you generally want to use YARPP. 😉

    But I think you’re asking more specifically, how to get *images* to be related to other things, particularly as they have to body text. The best I can suggest is to make sure you have relevant keywords in the title, or to use adequate tags.

    If tagging your posts is more of the issue, I believe there are some plugins out there that will suggest tags or even automatically add tags for you. It might help you to use something like that for a while to build up your base of tags.

    Hope that helps! 🙂

    The images are very heavily tagged so we have plenty of semantic info to work with on the image side.

    The posts are not typically tagged, or at least not well. So I would have to go on post content.

    So I guess the question is: If I am looking at a new post is there as function inside YARPP, that I can call (or copy and modify) that would help me find an image based on image-tags that is a good match for that new post?

    The difference being that I am looking for a related image instead of a related post.

    YARPP should work out of the box for images as well as posts, but there may be a little extra work to do in order to get this to show up. Specifically, how are your images handled? Are they posts like everything else, or are they in the Media Library, or are you using some special plugin? If they’re in the Media Library, how are you tagging them>

    They are in the Media Library, which creates an attachment-post-type post for each image. So we are tagging the attachment post by adding a field to the media uploader.

    I see. And I assume the “tags” you’re adding to the attachments are using the regular WordPress-standard post_tag terms.

    If so, you should be able to do this easily using YARPP’s custom post type support, though it may require some custom code. Check out the “other notes” section of the readme which will tell you about the custom post type support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Yet Another Related Posts Plugin] Finding related images’ is closed to new replies.