Skip to content

Instantly share code, notes, and snippets.

@elpuas
Created June 28, 2017 21:46
Show Gist options
  • Save elpuas/51b36e3947302e76f73e0a1db85023f7 to your computer and use it in GitHub Desktop.
Save elpuas/51b36e3947302e76f73e0a1db85023f7 to your computer and use it in GitHub Desktop.
Tabbed Content
<div id="responsive-tabs">
<ul class="horizontal">
<?php
if (have_rows('tabs')):
$i = 1;
while (have_rows('tabs')):
the_row();
?>
<li><?php
echo '<a href= "#tab-' . $i . '">' . get_sub_field("tab_link") . '</a>';
?></li>
<?php
$i++;
endwhile;
?>
</ul>
<?php
$i = 1;
while (have_rows('tabs')):
the_row();
?>
<?php
echo '<div id="tab-' . $i . '">' . get_sub_field("tab_content") . '</div>';
?>
<?php
$i++;
endwhile;
?>
</div>
<?php
else:
// no rows found
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment