'product_cat',
'orderby' => 'name',
'hide_empty' => false
);
$categories = get_categories($args);
$output = '';
foreach ($categories as $cat) {
if ($cat->slug === 'uncategorized') continue;
$thumb_id = get_term_meta($cat->term_id, 'thumbnail_id', true);
$image = wp_get_attachment_url($thumb_id);
if (!$image) {
$image = "https://via.placeholder.com/100x100?text=No+Image";
}
$output .= '
'.esc_html($cat->name).'
';
}
// Output TWICE for seamless infinite loop
echo $output . $output;
?>