Creating tabs with nested ACFs 3 levels
-
Hoping someone on here can help me. I have created a tab menu with a repeater field that should display in the tab pane. It does work and I can see the data with the inspector but nothing is displaying on the web page. Any ideas?
`if( have_rows(‘logiciels’) ):
$i = 1; // Set the increment variableecho ‘<ul class=”nav nav-tabs” id=”myTab” role=”tablist”>’;
// loop through the rows of data for the tab header
while ( have_rows(‘logiciels’) ) : the_row();
$header = get_sub_field(‘logiciel_type’);
?><?php $i++; // Increment the increment variable
endwhile; //End the loop
echo ‘
<div class=”tab-content” id=”myTabContent”>’;
$i = 1; // Set the increment variable// loop through the rows of data for the tab content
while ( have_rows(‘logiciels’) ) : the_row();
$header = get_sub_field(‘logiciel_type’);?>
<div class=”tab-pane fade show <?php if($i == 1) echo ‘active’;?>” id=”<?php echo sanitize_title($header); ?>” role=”tabpanel” aria-labelledby=”<?php echo sanitize_title($header); ?>-tab”><?php
while ( have_rows(‘contenu_type_logiciel’) ) : the_row(); ?>
<div class=”hentry why text-dark”><?php echo get_sub_field(‘titre’);?></div>
<div><?php echo get_sub_field(‘date’); ?></div>
<div>
<?php
$file = get_sub_field(‘fichier_a_telecharger’);
echo $file;
if ($file):$filesize = $file[‘filesize’];
$link = $file[‘link’];
?>
“>télécharger
<?php endif; ?>
<?php endwhile; //End the loop ?></div><?php $i++; // Increment the increment variable
endwhile; //End the loop
echo ‘</div>’;
else :
// no rows found
endif;
The topic ‘Creating tabs with nested ACFs 3 levels’ is closed to new replies.