My client wants a banner style image at the top of pages. It works on the single.php in my child theme like http://wineworldwarehouse.com/contact-us/ but I can't get it to work on the blog page http://wineworldwarehouse.com/blog/ or other custom page templates like http://wineworldwarehouse.com/testing/
In all of the templates I have the following code:
<div id="container">
<?php top_image() ?>
<div id="content">
Here is a snippet of the function
<?php
//Conditional top_image
function top_image() {
if (is_page('our-store') ) {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WineWorld.jpg" alt="wine bar" width="987"/></div> <?php }
elseif (is_page('tasting-bar') ) {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WineBar2.jpg" alt="wine bar" width="987"/></div> <?php }
elseif (is_page('classes') ) {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WinePurchase.jpg" alt="wine bar" width="987"/></div> <?php }
I have snipped out some of the image dueto length, here is the end of the function
elseif (is_page_template('single.php') ) {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WineBottle.jpg" alt="Wine Vendor" width="987"/></div> <?php }
elseif (is_page_template('blog-page.php') ) {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WineBottle.jpg" alt="Wine Vendor" width="987"/></div> <?php }
elseif (is_page(1338) ) {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WineBottle.jpg" alt="Wine Vendor" width="987"/></div> <?php }
else {?>
<div id="top">
<img src="<?php bloginfo('stylesheet_directory'); ?>/images/category/WineTasting.jpg" alt="wine tasting" width="987"/></div> <?php }
}
?>
Although the code for the top pages all work but none of the code in the bottom snippet works. It doesn't work if I am testing for page templates, for page ids or try to set a default image for single.php or any of the pages. I have tried hard coding the div and image link directly into custom templates but it doesn't work there either. I am really bonking my head on the desk over this one. Any suggestions are much appreciated.