Home › Forums › Add-ons › Repeater Field › Removing an element from last row of repeater › Reply To: Removing an element from last row of repeater
While you could just not display that <p>
element you could put that in a div and then set a border on the div, for example:
HTML
<div class="project-section">
<!-- your content here -->
</div>
CSS
.items .project-section {
border-top: 10px #000 solid;
}
.items .project-section:first-child {
border-top: none;
}
or you can alter the loop the way you suggest by doing something like this:
<span class="items">
<?php if( have_rows('repeater_indevelopment', 14) ): ?>
<?php
$rows = count(get_field('repeater_indevelopment'));
$count = 0;
?>
<?php while( have_rows('repeater_indevelopment', 14) ): the_row();
// vars
$project = get_sub_field('project', 14);
?>
<?php if ($project): ?>
<p class="projectname"><?php the_sub_field ('project', 14); ?> | <?php the_sub_field('medium', 14); ?></p>
<p class="projectstage"><?php the_sub_field ('status', 14); ?></p>
<?php
$count++;
if ($count < $rows) {
?><p class="devborder"></p><?php
}
?>
<br>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<p class="project name" ><?php the_field('nocontent', 14) ?></p>
</span>
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.