What is happening is the following...
In the header I am using a custom field to help populate a url string that returns the page banner based on the topic of the page and what is entered into a custom field "BannerIcon".
'#header{
background: #fff url("http://myweb.com/wp-content/uploads/2011/01/<?php global $wp_query;$postid = $wp_query->post->ID;echo get_post_meta($postid, 'BannerIcon', true); ?>") top center no-repeat;
}'
this builds:
'#header{
background: #fff url("http://myweb.com/wp-content/uploads/2011/01/Banner-Runner.jpg") top center no-repeat;
}'
This works for all pages except "Corporate News" which is the page that holds my blog Loop. in that case it returns:
'#header{
background: #fff url("http://myweb.com/wp-content/uploads/2011/01/") top center no-repeat;
}'
The above is leaving the banner area blank because the image name is absent which is telling me that no value is returned for my custom field "BannerIcon"
I do not know why all the other pages would work correctly and this one is not unless this has to do with the blog post loop being on the page.
So my questions are:
Why is this happening?
Is there a quick snipet of code I can use that in the event "BannerIcon" has no value or returns nothing defaults to "newImage.png"? Basically an If, then, else statement.
~NC