Skip to content

Instantly share code, notes, and snippets.

@mattboon
Created August 4, 2011 12:13
Show Gist options
  • Save mattboon/1125044 to your computer and use it in GitHub Desktop.
Save mattboon/1125044 to your computer and use it in GitHub Desktop.
Featured Slider Loop
<div id="featured">
<ul class="tabs">
<?php for ($i=1;$i<6;$i++): ?>
<?php
${"tab_".$i} = get_option('panel_tab_'.$i);
${"summary_".$i} = get_option('panel_summary_'.$i);
${"text_".$i} = get_option('panel_content_'.$i);
${"img_".$i} = get_option('panel_img_'.$i);
${"link_".$i} = get_option('panel_link_'.$i);
?>
<li class="link-<?= $i; ?>">
<a href="<?= get_permalink(${"link_".$i}); ?>">
<?= ${"tab_".$i} ?>
<br />
<em>
<?= ${"summary_".$i}; ?>
</em>
</a>
</li>
<?php endfor; ?>
</ul>
<?php for ($i=1;$i<6;$i++): ?>
<div class="link-<?= $i; ?>">
<?= ${"text_".$i} ? ${"text_".$i} : '' ?>
<?php if(${"link_".$i}): ?>
<a class="more" href="<?= get_permalink(${"link_".$i}); ?>">
Find out more
</a>
<?php endif; ?>
<?php if(${"img_".$i}): ?>
<img src="<?= ${"img_".$i} ?>" alt="<?= ${"tab_".$i} ?>" />
<?php endif; ?>
</div>
<?php endfor; ?>
</div><!-- #featured -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment