Get single Wordpress gallery image with given title

Posted by Wickethewok on Stack Overflow See other posts from Stack Overflow or by Wickethewok
Published on 2010-04-14T19:48:45Z Indexed on 2010/04/14 19:53 UTC
Read the original article Hit count: 162

Filed under:
|

I am having users of a Wordpress blog upload a single image to different post's galleries with the name "banner". Basically, every post will have an image named "banner" uploaded to its gallery and this image needs to be displayed on the post's page outside of the article content. So, how can I get the URL to display an image in a post's single.php template?

Can I iterate through the images of a given post's gallery and find the one with the correct title somehow?

I've searched through the Wordpress codex docs and haven't found anything on a way to do this, just information on displaying galleries of photos. Note that I'm already using Wordpress's post thumbnail feature for something else.

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about Wordpress