CodeCanyon

How to query specific amount of images from WP media library?

95 posts
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
mxpimp47 says

I have come across several queries, and I have read the codex. All examples say either one image or all. I want to display 6 images from the latest post of a specific category. Currently it will keep displaying images every time a new post is added. I cant seem to figure out how to limit the number of images echo’ed. I know how to do simple php array’s. But I dont know how to manipulate this in wordpress. This was the best thing I could come up with to achieve the results I am wanting. (edit – this was also the only way I could have the rel=”lightbox” tag for image lightbox plugin to work) Do you have any suggestions of maybe doing this differently?

Thanks, Clayton

here is a link to code – http://pastebin.com/9aH5ihKc

95 posts
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
mxpimp47 says

Anyone got an idea? I’m not super savvy with WP to figure this out. Been trying for several days.

by
by
by
by
by