/ Published in: PHP
                    
                                        
Insert banner image in wordpress page theme
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
// the page is "About", or the parent of the page is "About"
$bannerimg = '1';
} elseif ( is_pagearray(4)) ) {
$bannerimg = '2';
} elseif ( is_page('home') ) {
$bannerimg = '3';
} else {
$bannerimg = '4';
} ?>
<img src="<?php bloginfo('template_url'); ?>/images/image_<?php echo $bannerimg ?>.jpg" alt="<?php the_title(); ?>">
Comments
 Subscribe to comments
                    Subscribe to comments
                
                