Add custom ID attribute to all woocommerce products on archive pages
Copy /woocommerce/templates/content-product.php to /yourtheme/woocommerce/content-product.php and modify it as needed. In this case, we can change the opening <li> tag from this: <li <?php post_class(); ?>> to this: <li <?php post_class(); ?> id=”<?php echo esc_attr( ‘post-‘ . get_the_ID() ); ?>”> The updated content-product.php file will look like this: <?php /** * The template for displaying product … Read more