niko150
niko150

Reputation: 15

Wordpress different headers on each pages

is it possible to have different headers on each page? I'm currently using this code which works perfectly

<?php if(is_front_page()):?>
<?php echo do_shortcode('[myiamge1]'); ?>

<?php endif;?>

Now I tried to use this code and it doesnt work

<?php if(is_front_page()):?>
<?php echo do_shortcode('[myiamge1]'); ?>

else { ?> (is_page('Contact')){
echo '<img src="image5.jpg" />';
}

<?php endif;?>

Any ideas?

Upvotes: 0

Views: 87

Answers (1)

Professor Abronsius
Professor Abronsius

Reputation: 33804

I know nothing about Wordpress - never used it but the above doesn't look right. Is there a reason whya more traditional style syntax is not adopted - more akin to this:

<?php
    if( is_front_page() ){
        echo do_shortcode('[myiamge1]');
    } elseif( is_page('Contact') ){
        echo '<img src="image5.jpg" />';
    } else {
        /*banana for scale - do something else*/
    }
?>

Upvotes: 1

Related Questions