Often the header area of a website is left static and often is left quite plain. On many websites the header area is often wasted space and should be put to use. By regularly changing images you can enrich the website. If you are clever and use the right images you can add content that compliments your site content.
For instance every month you could ‘program’ the template to change the header image. You can even change the image based on the day. Why? Well first of all it adds variety to your website even if the ‘main’ content is not regularly changing, but also it could help with promotion.
Example – The Online Shop
You could use the area to promote seasonal items you regularly sell or link to a section promoting a range of goods. Items related to special occasions such as Mother’s Day, Christmas or Summer Holidays all spring to mind.
Example – The location site
A website covering a location could have a different photo per month covering the location at that time of year.
The code
The example code below queries what the month is and then an image is displayed based upon the result. The template / theme index file needs to be a php file. i.e. index.php and in this file place towards the top area:
<?php
$month = date("m");
if ( $month == "01" ) $photo = '1.jpg' ;
if ( $month == "02" ) $photo = '2.jpg' ;
if ( $month == "03" ) $photo = '3.jpg' ;
if ( $month == "04" ) $photo = '4.jpg' ;
if ( $month == "05" ) $photo = '5.jpg' ;
if ( $month == "06" ) $photo = '6.jpg' ;
if ( $month == "07" ) $photo = '7.jpg' ;
if ( $month == "08" ) $photo = '8.jpg' ;
if ( $month == "09" ) $photo = '9.jpg' ;
if ( $month == "10" ) $photo = '10.jpg' ;
if ( $month == "11" ) $photo = '11.jpg' ;
if ( $month == "12" ) $photo = '12.jpg' ;
?>
Then in your header div place the following:
<img src="<?php echo $photo; ?>" alt="header">
Hire Neogain
Neogain are website experts and know how to program php. Our business based in the UK has the administration, content creation, design and marketing expertise that your website requires. We are used to creating websites from scratch or improving existing sites.
No comments:
Post a Comment