James,
Thanks for looking into this for me. Unfortunately I have a memory like a fish, and I haven’t got the foggiest what this was about.
If I remember I will let you know.
Thanks again,
John
Hey Dave,
What a coincidence seeing you here – ha!
The way to do that is check if it’s the first iteration of the while loop:
<div class="tabs">
<?php if(get_field('additional_content')): $i = 0; ?>
<?php while(has_sub_field('additional_content')): $i++; ?>
<input type="radio" name="tabs" id="tab<?php echo $i; ?>"<?php if($i == 0) { echo " checked"; };?> />
<label for="tab<?php echo $i; ?>" class="<?php the_sub_field('field_label'); ?>"><?php the_sub_field('extra_title'); ?></label>
<?php endwhile; ?>
<?php endif; ?>
<?php if(get_field('additional_content')): $i = 0; ?>
<?php while(has_sub_field('additional_content')): $i++; ?>
<div id="tab-content<?php echo $i; ?>" class="tab-content">
<?php the_sub_field('extra_content'); ?>
</div> <!-- #tab-content1 -->
<?php endwhile; ?>
<?php endif; ?>
</div>
Hi James
Thanks for getting back to me. Sorry I wasn’t more specific in my question. It isn’t the jQuery tabs I needed; it was the ability to add or filter the checkbox choices “on-the-fly” using the ajax input.
Thanks.
John