Jump to content
Sign in to follow this  
leftcoastmichael

I want to show multiple home pages

Recommended Posts

leftcoastmichael

Hi. I have three different 'home' pages that I would like to have appear randomly when someone visits our web site. Is this possible with any of the the iBlog Pro templates, or perhaps with a widget?

Share this post


Link to post
Share on other sites
bryan-hadaway

Try adding this to your header.php just under

<body <?php body_class(); ?>>
:
<?php if (is_home()) { ?>
<script type="text/javascript">
	var randomHomepage=new Array()
randomHomepage[0]="http://www.website.com/";
	randomHomepage[1]="http://www.website.com/";
	randomHomepage[2]="http://www.website.com/alternate1/";
	randomHomepage[3]="http://www.website.com/alternate2/";
window.location=randomHomepage[Math.floor(Math.random()*randomHomepage.length)]
	</script>
<?php } ?>

That should work perfectly for you. Put your main home URL for the first 2 and then the other 2 alternates for the others. Thanks, Bryan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×