I’m not exactly sure where you want your clearfix to come in, but you should be able to do something like this:
<div class="row">
<?php
$libargs=array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 0,
'exclude' => array(16, 20, 22,25, 27, 28, 30, 4), //* Enter ID's of parent categories to exclude from list
'taxonomy' => 'industrygroups',
'parent' => '',
);
$libcats=get_categories($libargs);
$i = 0;
foreach($libcats as $lc){
if( $i % 4 == 0 ) {
/* INSERT CLEARFIX STUFF */
}
$i++;
echo '<div class="col-lg-3 col-md-4 col-sm-6 col-xs-6 ">';
$termlink = get_term_link( $lc->slug, 'industrygroups' );
?>
<div class="thumbnail">
<div class="caption">
<br/><br/>
<h1><span class="label label-warning"><?php echo $lc->count ?></span></h1>
<p> Symbols </p>
<p> <a class="label label-default" href="https://wordpress.stackexchange.com/questions/158346/<?php echo $termlink; ?>"> View Group</a> </p>
<!-- basic text field display start -->
<p> <?php the_field('basictext', 'industrygroups_'.$lc->term_id); ?></p>
<!-- basic text field display end -->
</div>
<!-- Get Image by Attachment ID Start-->
<?php
$attachment_id = get_field('taximage', 'industrygroups_'.$lc->term_id);
if ($attachment_id) {
$image = wp_get_attachment_image_src($attachment_id, 'industrygroup-img');
if ($image) {
?>
<img class="img-responsive" src="<?php echo $image[0]; ?>" />
<?php
}
}
?>
<!-- Get Image by Attachment ID End-->
</div>
<small><p class="text-center"> <a href="https://wordpress.stackexchange.com/questions/158346/<?php echo $termlink; ?>"> <?php echo $lc->name; ?></a> </p> </small>
<?php echo '</div>'; }?>
</div>