Answer the question
In order to leave comments, you need to log in
How to set a unique cheze ACF identifier for tabs?
Hello!
I have products (goods) on my site - and each has a block with
tabs
.
only one taboo?
Here is a piece of code:
<ul>
<?php while ( have_rows( 'taby' ) ) : the_row(); ?>
<?php $field = get_sub_field_object('zagolovok_taba'); ?>
<li data-tab="tab-<?php echo $field['key']; ?>"><a href="#"><?php the_sub_field( 'zagolovok_taba' ); ?></a></li>
<?php endwhile; ?>
</ul>
Answer the question
In order to leave comments, you need to log in
I did it .. suddenly it will help someone - here:
<ul>
<?php while ( have_rows( 'taby' ) ) : the_row(); $i++ ?>
<li data-tab="tab-<?php echo $i; ?>"><a href="#"><?php the_sub_field( 'zagolovok_taba' ); ?></a></li>
<?php endwhile; ?>
</ul>
<?php $i = 0; ?>
<?php while ( have_rows( 'taby' ) ) : the_row(); $i++ ?>
<div id="tab-<?php echo $i; ?>"></div>
<?php endwhile; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question