Add SKU After WooCommerce Product Title on Archive Pages

This is a Developer Level doc.

If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.

If you wish to display the product SKU number after product titles on WooCommerce archive pages, use the following PHP snippet:

add_action( 'woocommerce_after_shop_loop_item_title', 'custom_after_title' );

function custom_after_title() {
global $product;
if ( $product->get_sku() ) {
echo $product->get_sku();
}
}

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.