Home › Forums › Support › Display Woocommerce SKU This topic has 7 replies, 2 voices, and was last updated 4 years, 7 months ago by Tom. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts August 23, 2019 at 8:22 pm #991984 Jono Hi, I’m trying to display the SKU in the archive listing of products in Woocommerce. I’ve worked through https://generatepress.com/forums/topic/woocommerce-archive-pages-show-sku-3/ which is exactly what I need. But I can’t make it work! I’ve got the correct hook and I’ve selected Execute PHP. But it just outputs the PHP as text.. Am I missing something really obvious? I’ve added the staging site URL to this post. Many thanks. August 24, 2019 at 9:41 am #992412 TomLead Developer Lead Developer Hi there, Can you share the function you’re currently using? Let me know ๐ August 24, 2019 at 2:39 pm #992543 Jono Hey Tom, thanks for the reply. I’m using David’s code from the thread referenced above. add_action( 'woocommerce_single_product_summary', 'db_after_single_product_title', 6 ); function db_after_single_product_title() { // your content here } August 24, 2019 at 2:58 pm #992552 TomLead Developer Lead Developer What about this one?: https://generatepress.com/forums/topic/woocommerce-archive-pages-show-sku-3/#post-619232 August 24, 2019 at 3:02 pm #992554 Jono Thanks Tom! Unfortunately not… It just adds the code as plain text in the item title link. https://blueislandpress.com.au/staging2019/product-category/artists/emily-hamilton/ August 24, 2019 at 4:10 pm #992581 TomLead Developer Lead Developer Are you adding it as a Hook Element? If so, try this instead: <?php global $product; echo '<span class="custom_sku">Part no. ' . $product->get_sku() . '</span>'; ?> And make sure “Execute PHP” is checked. August 25, 2019 at 6:16 pm #993378 Jono Perfect!! Thanks so much Tom. August 26, 2019 at 8:42 am #993897 TomLead Developer Lead Developer You’re welcome ๐ Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In