From: Anthony Talarico Date: Fri, 30 Nov 2018 15:16:51 +0000 (-0500) Subject: adding count increment for the blocks loop X-Git-Tag: v1.6.2^2~7 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=b21cb50bbd2f8d1878b3d66c84e89d13de3520c5;p=WP-Plugins%2Fglm-blocks.git adding count increment for the blocks loop --- diff --git a/glm-blocks.php b/glm-blocks.php index a5f8bbd..a65f534 100644 --- a/glm-blocks.php +++ b/glm-blocks.php @@ -63,6 +63,7 @@ function landing_page_blocks( $atts ) $category = filter_var($atts['category'], FILTER_VALIDATE_INT); $blocks = fetch_all_glm_blocks($category); $out .= '
'; + $count = 0; foreach ($blocks as $block): $post_image_id = get_post_thumbnail_id($block->ID); $thumbnail = wp_get_attachment_image_src( $post_image_id, 'landing_page'); @@ -81,6 +82,7 @@ function landing_page_blocks( $atts ) $out .= '
'; endif; $out .= ''; + $count++; endforeach; $out .= ''; endif;