admin管理员组文章数量:1391943
In the functions.php I use:
add_shortcode( 'output_post_sku', 'get_sku' );
And retrieve it with shortcode: [output_post_sku]
It doesn't work. Anyone familiar with this?
Thank you!
In the functions.php I use:
add_shortcode( 'output_post_sku', 'get_sku' );
And retrieve it with shortcode: [output_post_sku]
It doesn't work. Anyone familiar with this?
Thank you!
Share Improve this question asked Feb 25, 2020 at 11:57 BrentBrent 1 1 |1 Answer
Reset to default 0SKU display on product detail page. Add this code in functions.php
add_action( 'woocommerce_single_product_summary', 'show_sku', 5 );
function show_sku(){
global $product;
echo 'SKU: ' . $product->get_sku();
}
本文标签: functionsI want to display the sku in the product pages of my EDD website
版权声明:本文标题:functions - I want to display the sku in the product pages of my EDD website 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744716517a2621433.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
get_sku
? Is the SKU coming from EDD or somewhere else? When you say it doesn't work, can you be more specific? PHP fatal error? White screen of death? Empty output? Incorrect output? – Tom J Nowell ♦ Commented Feb 25, 2020 at 14:24