blockTitle; $postCategories = $args->categories; $titleOption = $args->titleOption; $countOption = $args->countOption; $content_type = $args->type; ?>
'', 'item_title' => esc_html__( 'Featured Link', 'bloginwp' ), 'item_url' => '', 'item_option' => 'show' ) ))); $featured_links_items = json_decode( $featured_links_items ); if( $featured_links_items ) : foreach( $featured_links_items as $item_key => $item ) : if( $item->item_option ) { ?> explode( ",", $postCategories ) ) ); } else { $postCategories = get_categories(array( 'number' => 4 )); } foreach( $postCategories as $postCat ) : $cat_name = $postCat->name; $cat_count = $postCat->count; $cat_slug = $postCat->slug; $category_id = $postCat->cat_ID; $block_post = new WP_Query( array( 'category_name' => esc_html( $cat_slug ), 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ), ) ) ); if( $block_post->have_posts() ) : while( $block_post->have_posts() ) : $block_post->the_post(); $thumbnail_url = get_the_post_thumbnail_url( get_the_ID(), 'bloginwp-featured-list' ); endwhile; endif; ?>
' .esc_html( $cat_name ).''; } if( $countOption ) { echo '   ' .absint( $cat_count ). ' '; } ?>