// Get product categories
$categories = wp_get_post_terms($product->get_id(), 'product_cat');
$category_names = array();
foreach ($categories as $category) {
$category_names[] = $category->name;
}
$category_names_string = implode(', ', $category_names);
?>
Step 2: Add Custom CSS
Add the following CSS to your theme's style.css file or through the WordPress Customizer by navigating to Appearance > Customize > Additional CSS:
css
Copy code
/* Hide the image thumbnail for the product category */
.product-category img {
display: none;
}
Step 3: Update Homepage Template
Ensure your homepage template code integrates with the modified content-product.php:
php
Copy code
// Get product categories
$categories = wp_get_post_terms($product->get_id(), 'product_cat');
$category_names = array();
foreach ($categories as $category) {
$category_names[] = $category->name;
}
$category_names_string = implode(', ', $category_names);
?>
Step 2: Add Custom CSS
Add the following CSS to your theme's style.css file or through the WordPress Customizer by navigating to Appearance > Customize > Additional CSS:
css
Copy code
/* Hide the image thumbnail for the product category */
.product-category img {
display: none;
}
Step 3: Update Homepage Template
Ensure your homepage template code integrates with the modified content-product.php:
php
Copy code
// Get product categories
$categories = wp_get_post_terms($product->get_id(), 'product_cat');
$category_names = array();
foreach ($categories as $category) {
$category_names[] = $category->name;
}
$category_names_string = implode(', ', $category_names);
?>
Step 2: Add Custom CSS
Add the following CSS to your theme's style.css file or through the WordPress Customizer by navigating to Appearance > Customize > Additional CSS:
css
Copy code
/* Hide the image thumbnail for the product category */
.product-category img {
display: none;
}
Step 3: Update Homepage Template
Ensure your homepage template code integrates with the modified content-product.php:
php
Copy code