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!
I think I finally figured it out. The part I couldn’t figure out was using the vaguely named
get_children()
function.