Hi again,
yesterday, I ran into one minor problem using this solution. It works awesome for pages, but not for the blog page, archive pages, single posts etc.
Let’s say, I want to make the header element for the blog page retina-ready. I could modify the function like so
if( is_page() || is_home() ) {...
However, this will grab the featured image of the first post and not of the blog page itself. I know, I could use CSS like so:
.blog .page-hero, .archive .page-hero, .single-post .page-hero {...}
Is there a more elegant solution for this? It’s not a big deal, since the same hero image is used for these pages. So, the CSS solution would be fine, but I just wanted to ask anyway.