Dude it works! One slight issue though. I dont have a link at this time for one of the images which is âteam-vegasâ Is there a way around showing the image even if i dont have the link yet? Here is your code with my added links. If i leave any of them blank without a url the image doesnt populate.
[php]
?php /* Template Name: About */ ?>
<?php
get_header();
function shuffle_assoc($sponsors) {
if (!is_array($sponsors)) return $sponsors;
$keys = array_keys($sponsors);
shuffle($keys);
$random = array();
foreach ($keys as $key)
$random[$key] = $sponsors[$key];
return $random;
}
?>
<?php if(have_posts()) while(have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php if(is_page(44)): ?>
<h2 class="text-left">United States</h2>
<?php
$sponsors = array(
'body-building' => 'http://es.bodybuilding.com/store/liquid-grip/liquid-grip.html?_requestid=1337933',
'europa' => 'http://www.europasports.com',
'gnc' => 'www.gnc.com',
'lucky-vitamin' => 'www.luckyvitamin.com',
'max-muscle' => 'www.php.net',
'planet-fastpitch' => 'www.phphelp.com',
'rogue-fitness' => 'http://www.roguefitness.com/liquid-grip.php?SID=gnoti8nf49f44i0n0sl27aem87',
'team-vegas',
'the-vitamin-shoppe' => 'www.vitaminshoppe.com',
'usa-sports' => 'http://www.musclefoodsusa.com',
'us-gym-products' => 'www.usgymproducts.com',
'vinces-muscle-shop' => 'www.vincesmuscleshop.com'
);
$sponsors = shuffle_assoc($sponsors);
?>
<?php foreach($sponsors as $company => $c_url): ?>
<div class="sponsor">
<div class="sponsorFlip">
<a href="<?php echo $c_url; ?>">
<img src="<?php bloginfo('url'); ?>/media/img/sponsors/<?php echo $company; ?>.png" alt="<?php echo ucfirst(str_replace("-"," ",$company)); ?>" height="140" width="140" />
</a>
</div>
</div>
<?php endforeach; ?>
<div class="clear h-space10"></div>
<h2 class="text-left">International</h2>
<?php
$sponsors = array(
'atari' => 'test.com',
'fit-4-fight' => 'http://www.fit4fight.dk/shop/liquid-grip-45-1634p.html',
'fitness-sport' => 'http://www.xyz.com',
//'fitness-depot',
'iconceptions' => 'http://i-conceptions.com/novosti/innovatsionnyiy_grip_-_liquid_grip',
//'nutrition-club',
'phantom-mma' => 'www.phantom-mma.com',
'spelemat' => 'www.spelemat.com',
//'supplement-source',
'the-sport-station' => 'www.sportstationusa.com',
'vantage-fighting' => 'http://www.vantage-fighting.com/liquid-grip-45ml-16289'
);
$sponsors = shuffle_assoc($sponsors);
?>
<?php foreach($sponsors as $company => $c_url): ?>
<div class="sponsor">
<div class="sponsorFlip">
<a href="<?php echo $c_url; ?>">
<img src="<?php bloginfo('url'); ?>/media/img/sponsors/<?php echo $company; ?>.png" alt="<?php echo ucfirst(str_replace("-"," ",$company)); ?>" height="140" width="140" />
</a>
</div>
</div>
<?php endforeach; ?>
<div class="clear h-space10"></div>
<div class="text-center" style="font-size:16px;">
For <img src="<?php bloginfo('url'); ?>/media/img/canada.gif" height="15" width="23" /> Canada orders
<a target="_blank" href="http://www.liquidgripcanada.com">click here</a>
and <img src="<?php bloginfo('url'); ?>/media/img/australia.gif" height="15" width="23" /> Australia orders
<a target="_blank" href="http://www.bodybuilding.com/store/liquid-grip/liquid-grip.html;jsessionid=5E0E17CA3439B44075A6B00C8ECC82FC">click here</a>
</div>
<?php endif; ?>
<?php get_footer(); ?>
[/php]