PrimePress Theme for WordPress Rotating Header Image

WordPress Page specific Header Images

I saw some people looking to display a different image on each WordPress Page instead of the site wide random images. Read on...

First, I'll give you the code and explain how it works. That way, you'll understand it better and can easily adapt it to your site.

The Code

<?php if (is_page('28')) { ?>
	<img src="<?php bloginfo('template_url'); ?>/headers/image1.jpg" width="920" alt="<?php bloginfo('name'); ?> header image" />
<?php } elseif (is_page('26')) { ?>
	<img src="<?php bloginfo('template_url'); ?>/headers/image2.jpg" width="920" alt="<?php bloginfo('name'); ?> header image" />
<?php } elseif (is_page('30')) { ?>
	<img src="<?php bloginfo('template_url'); ?>/headers/image3.jpg" width="920" alt="<?php bloginfo('name'); ?> header image" />
<?php } else { ?>
	<img src="<?php bloginfo('template_url'); ?>/rotating.php?image=<?php echo mt_rand(0,100); ?>" width="920" alt="<?php bloginfo('name'); ?> Rotating Header Image" title="<?php bloginfo('name'); ?> Random Header Image" />
<?php } ?>

I have 3 Pages here. With the above code, I'm telling the theme to display a given image on each of those 3 Pages and to display random images everywhere else.

  • 1st two lines tell the theme to display image1.jpg on a Page with ID 28.
  • next two lines tell it to display image2.jpg on a Page with ID 26 and so on.
  • Last two lines (marked in blue) tell it to display random images everywhere else.

How to

  1. Upload your header images into the headers folder in your PrimePress directory.
  2. Open your header-images.php in your WordPress theme editor, delete the already existing code and paste the above code block in there.
  3. Change the Page ID and the image file name according to your site. (parts marked in red)

Some Notes

Chances are, you want to do this on more than three pages. Just copy (duplicate) the lines marked in green, paste them right below (but above lines marked in blue) and change the ID and filename.

If you have permalinks turned on, you can also type in the post-slug in place of the Page IDs.

Support forums are up and live!

Thank you so much people! for your ever broadening interest in this WordPress theme.

Earlier on, I assumed support through comments would be sufficient for PrimePress. I was wrong. Support process is getting way too dis-organized and it's getting increasingly hard to find the right info under the relevent post. Continue reading →

Setting up the WordPress Static Homepage

Some of you might want to display a static front page as the homepage of your WordPress blog. This can now be done in PrimePress using Page templates and here's a quick tutorial. No fancy magazine style layouts right now but a simple Page with the content of your choice. Continue reading →

Theme Customization: 2 simple ways to personalize your theme

Its amazing how some simple CSS tweaks like changing the background color or adding a border can drastically change the overall design of a site.

Here are two ways you can personalize your site by adding some simple bits of code to your custom stylesheet. Just paste these code snippets into the custom.css Continue reading →

Customizing Rotating Header Images

"...Worth a Thousand Words"
another boring cliche that has lost its intended meaning? hell no! It has been over-used alright... (and I wouldn't dare say that out loud) but its true to its every word.

A few well chosen images - can add tons of visual appeal to your site, can convey more information, can make a good site a great one. so gather up all the pictures you like, putting them up in PrimePress is easy. Continue reading →