0

I'm want to use the Recent Photos Plugin in my sidebar to show the last uploaded photos but instead of linking them to the bigger versions of the images I want to link to the post they were used in. Can somebody tell me how I get the link of the last post an image was used in?

Thanks, udo

optikfluffel
  • 2,538
  • 4
  • 20
  • 27
  • If you do a sidebar based on the posts and display the image you can display the image from a post then have it link to the permalink based on the post. If you do it based on the images like you are doing, there is no identifier that tells wordpress whether or not the image is part of any particular post. So in turn if you wanted, you can set a condition to pull posts and put it in a array and have it cross reference and descend the order by the date of upload per image. – Robert Lee Mar 01 '13 at 16:48
  • So I have to get an array of the lasts posts, drop the ones with no images attached and then use it that way? – optikfluffel Mar 04 '13 at 13:42
  • yes i think that would be the way you would want to go. – Robert Lee Mar 04 '13 at 14:15
  • Thanks :) If you put that in an answer down here you could catch some points ^^ – optikfluffel Mar 04 '13 at 17:57
  • will do thanks appreciate it. – Robert Lee Mar 04 '13 at 21:39

1 Answers1

0

If you do a sidebar based on the posts and display the image you can display the image from a post then have it link to the permalink based on the post. If you do it based on the images like you are doing, there is no identifier that tells wordpress whether or not the image is part of any particular post. So in turn if you wanted, you can set a condition to pull posts and put it in a array and have it cross reference and descend the order by the date of upload per image.

Robert Lee
  • 1,541
  • 1
  • 10
  • 20