Just wanted to say, 6 months after the fact that this totally saved me from a mental breakdown today. After 1.5 hours of scouring this site I found this, thought I’d document what I was trying to do and what I did to fix it.
First of all, I’m using WordPress as a CMS in this case, with no blog. Each page of the CMS uses a unique banner image, and I wanted to put this in my template to have it automated. Here’s what I originally started with: