Home › Forums › Front-end Issues › Repeater: display element flex with bootstrap
Hi
So I have a repeater field that I am using to trigger some modal windows.
So far I can trigger the modal but the triggers (buttons
) are not displayed flex in a row.
What I would like is to have 6 buttons next to each other using flex.
I am using Bootstrap 4 and this is my code
<div class="team-section" id="block-24">
<div class="container bloc-lg">
<div class="row">
<div class="col-lg-12">
<div class="container-team-large">
<div class=" ">
<?php
/**
* Bootstrap ACF While Loop Modals
*/
// *Repeater
// modal_repeater
// *Sub-Fields
// modal_header
// modal_body
// modal_footer
// check if the repeater field has rows of data
if( have_rows('member') ):
$i = 1; // Set the increment variable
// loop through the rows of data
while ( have_rows('member') ) : the_row();
$modal_photo = get_sub_field('photo');
$modal_name = get_sub_field('name_vorname');
$modal_title = get_sub_field('title');
$modal_position = get_sub_field('position');
$modal_telefon = get_sub_field('telefon');
$modal_email = get_sub_field('email');
?>
<!-- Button to Open the Modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal-<?php echo $i;?>">
<img src="<?php the_sub_field( 'photo' ); ?>" class="img-fluid" />
</button>
<!-- The Modal -->
<div class="modal" id="myModal-<?php echo $i;?>">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title"><?php echo $modal_name;?></h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<?php echo $modal_title; ?>
<?php echo $modal_position; ?>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<?php $i++; // Increment the increment variable
endwhile; //End the loop
else :
// no rows found
endif;
?>
</div>
</div>
</div>
</div>
</div>
</div>
Now the Images (modal trigger) are displayed in 2 rows (screenshot attached). I would like to have 6 images in one row
Many thanks in advance!
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.