incrementing php value (++) not working after update
-
Hello, after update to your newest version, the PHP incrementation is not working in the repeater template.
$countclass = 1; <div class="b_overview_item b_ov_item_<?php echo $countclass++; ?>">
The whole code is this:
<?php $countclass = 1; $countclass_wrap = 1; ?> <?php foreach((get_the_category()) as $category) { $catoname = $category->cat_name; }; ?> <?php $bn_badge_name = get_field( "bn_badge_name" ); $bn_offer_until_date = get_field( "bn_offer_until_date" ); $bn_special_offer_link = get_field( "bn_special_offer_link" ); ?> <div class="b_overview_itemwrap _<?php echo strtolower($catoname);?> b_ov_wrapitem_<?php echo $countclass_wrap++; ?>"> <div class="b_overview_item b_ov_item_<?php echo $countclass++; ?>"> <div class="b_overview_logo"> <?php if($bn_offer_until_date !=""): ?> <div class="b_overview_date"><i class="fa fa-calendar" aria-hidden="true"></i> <?php echo $bn_offer_until_date;?></div> <?php endif;?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php if($countclass ==1){ the_post_thumbnail_url("large"); }else{the_post_thumbnail_url("medium");}?>" alt="<?php echo get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true );?>"/></a> </div> <div class="title_link_wrap"> <div class="b_overview_title"> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> </div> <?php if ($countclass == 1):?> <span class="b_excerpt"><?php the_excerpt();?></span> <?php endif;?> <div class="b_overview_linkbar"> <div class="b_overview_links"> <a class="b_infos" href="<?php the_permalink(); ?>">MORE</a> <?php if($bn_special_offer_link !=""): ?> <a href="<?php echo $bn_special_offer_link;?>" class="b_ext" target="_blank" rel="nofollow">GET OFFER <i class="fa fa-chevron-right" aria-hidden="true"></i></a> <?php endif;?> </div> </div> </div><div class="clear"></div> </div> </div>
Do you know how to make it work again, please?
Thanks, Nico
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘incrementing php value (++) not working after update’ is closed to new replies.