6, // Limit to 8 categories 'orderby' => 'title', 'order' => 'ASC', 'hide_empty' => false ); $product_categories = get_terms('product_cat', $args); $count = count($product_categories); $limit = 8; // Set limit to 8 if ($count > 0) { $counter = 0; foreach ($product_categories as $product_category) { if ($counter >= $limit) break; // Stop loop after 8 categories $counter++; $image = esc_html(get_template_directory_uri()).'/assets/images/default.png'; // Set default image if (function_exists('get_term_meta')) { if (isset($product_category->term_id)) { // Get the thumbnail ID $thumbnail_id = get_term_meta($product_category->term_id, 'thumbnail_id', true); if ($thumbnail_id) { // Get the image URL for parent category $image = wp_get_attachment_url($thumbnail_id); } } } if (isset($product_category->name)) { echo ''; } } } ?>

'; echo '

No new arrival products found.

'; echo '
'; } } ?>