'; if ($showHeader) { $html .= '
'; if ($showIcon) { $cat_icon_id = get_term_meta($term->term_id, 'doc_category_image-id', true); if ($cat_icon_id) { $cat_icon = wp_get_attachment_image($cat_icon_id, 'thumbnail', ['alt' => esc_attr(get_post_meta($cat_icon_id, '_wp_attachment_image_alt', true))]); } else { $cat_icon = 'betterdocs-category-grid-icon'; } $html .= '
' . $cat_icon . '
'; } if ($showTitle) { $html .= '<' . $titleTag . ' class="el-betterdocs-cat-title">' . $term->name . ''; } if ($showCount) { $html .= '
' . $term_count . '
'; } $html .= '
'; } if ($showList) { $html .= '
'; $args = array( 'post_type' => 'docs', 'post_status' => 'publish', 'posts_per_page' => $postsPerPage, 'tax_query' => array( array( 'taxonomy' => 'doc_category', 'field' => 'slug', 'terms' => $term->slug, 'operator' => 'AND', 'include_children' => false, ), ), ); $args['orderby'] = $postsOrderBy; $args['order'] = $postsOrder; $query = new \WP_Query($args); if ($query->have_posts()) { $html .= ''; } wp_reset_query(); // Nested category query if ($enableNestedSubcategory) { include BETTERDOCS_DIR_PATH . 'includes/gutenberg/template/category-grid/Nested_Subcategory.php'; } $html .= '
'; } $html .= ''; $html .= '
'; $html .= '';