From b21cb50bbd2f8d1878b3d66c84e89d13de3520c5 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 30 Nov 2018 10:16:51 -0500 Subject: [PATCH] adding count increment for the blocks loop --- glm-blocks.php | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.17.1