Return to Snippet

Revision: 23228
at February 1, 2010 14:13 by toro999


Updated Code
<?php if ( is_page(array(1,2,3)) ) {    
    // 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(); ?>">

Revision: 23227
at February 1, 2010 13:51 by toro999


Initial Code
<?php if ( is_page(array(1,2,3)) ) {    
    // 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/immagine<?php echo $bannerimg ?>.jpg" alt="<?php the_title(); ?>">

Initial URL

                                

Initial Description
Insert banner image in wordpress page theme

Initial Title
Insert img in wordpress page theme

Initial Tags
php, html, wordpress

Initial Language
PHP