I have a trouble giving link to the image in a array.
$sponsors = array(
array('id-1','tier1','app','http://www.google.com/'),
Here is the loop across the array, where
<?php
foreach($sponsors as $company)
{
echo'
<li data-id="'.$company[0].'" data-type="'.$company[1].'" style="">
<img src="/wp-content/themes/sustainability/assets/images/members/'.
$company[1].'-'.$company[2].
'.jpg" alt="More about '.$company[2].'" />
<a href="#"></a>
</li>';
}
?>
Would it not be easier to build an associative array?
array('id' => 'id-1','data-type' => 'tier1', 'key' => 'app', 'link' => 'http://www.google.com/'),
//......etc etc
Allowing you to loop through it and print it out as you'd like?
<?php
foreach($sponsors as $company)
{
echo'
<li data-id="'.$company['id'].'" data-type="'.$company['data-type'].'" style="">
<img src="/wp-content/themes/sustainability/assets/images/members/'.
$company['data-type'].'-'.$company['key'].
'.jpg" alt="More about '.$company['key'].'" />
<a href="#"></a>
</li>';
}
?>
Note: I don't know what your key
is called? So you'll want to change that to whatever it is? probably product
right?