Posted By

toro999 on 02/01/10


Tagged

php html wordpress


Versions (?)

Insert img in wordpress page theme


 / Published in: PHP
 

Insert banner image in wordpress page theme

  1. <?php if ( is_page(array(1,2,3)) ) {
  2. // the page is "About", or the parent of the page is "About"
  3. $bannerimg = '1';
  4.  
  5. } elseif ( is_pagearray(4)) ) {
  6. $bannerimg = '2';
  7.  
  8. } elseif ( is_page('home') ) {
  9. $bannerimg = '3';
  10.  
  11. } else {
  12. $bannerimg = '4';
  13. } ?>
  14.  
  15. <img src="<?php bloginfo('template_url'); ?>/images/image_<?php echo $bannerimg ?>.jpg" alt="<?php the_title(); ?>">

Report this snippet  

You need to login to post a comment.