PHP/Wordpress Page Variables: "php if (is_front_page()"?

Swimmer.24

New member
Using Worpress,
I have specific pages I want banners on. But if there other pages that I dont specify, I want it to call out a back-up banner. (the pages that are not listed/defined) How can I do is?

Below is an example of the code
I have the front page as one
The rest of the pages
And the about page

The problem I am running into is that BOTH the 'about' and the 'backup' banner show up on the same page, I just want the 'about' banner to show up on the About page but if i were to create another page, it would use the 'backup' banner as a default unless I define it otherwise.

/*---CODE BLEOW---*/

<?php if (is_front_page()): ?>
<div id='header-bannerspace'><?php echo do_shortcode('[bannerspace category_name=bannerspace_homepage]'); ?></div>
<?php endif; ?>

<?php if (is_page($page)): ?>
<div id='header-bannerspace'><?php echo do_shortcode('[bannerspace category_name=bannerspace_backup'); ?></div>
<?php endif; ?>

<?php if (is_page(about)): ?>
<div id='header-bannerspace'><?php echo do_shortcode('[bannerspace category_name=bannerspace_about]'); ?></div>
<?php endif; ?>
Could you elaborate on the "elseif" i have been trying that and I cant seem to get it to work. Thats why im asking. My page just shows up blank when i try to change the code from "if" to "elseif"
 
Back
Top