I have a style.php setup which is being called using this code:
<?php include (TEMPLATEPATH . '/includes/css/styles.php');?>
This style sheet contains this code:
<?php $thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'title-image', true);
$thumb_url = $thumb_url_array[0]; ?>
<style>
/* GET FEATURED IMAGE FOR TITLE BACKGROUND */
.titlearea {
<?php if(has_post_thumbnail()): ?>
background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('<?php echo $thumb_url ?>');
<?php else: ?>
background: url('http://www.example.com/wp-content/themes/my-custom-theme/includes/images/services-top.jpg');
<?php endif; ?>
background-size: cover;
background-position: 50% 0;
}
</style>
Which should look for a post thumbnail (im using Wordpress) and display that as the background image if there is one, if the page doesnt have a thumbnail then it should fallback to the default (services-top.jpg).
This code is working great in Chome and Firefox but IE9 is just showing a white background, its not even registering the fallback defautl image.
Anyone know why this isnt working?
Thanks