WooCommerce:在产品详情页面显示发布日期

仿牌独立站出海专家


add_action( 'woocommerce_single_product_summary','bloomer_echo_product_date',25 );
 
function bloomer_echo_product_date() {
if ( is_product() ) {
echo the_date('', '<span class="date_published">Published on: ', '</span>', false);
}
}
 
// Change the date format: https://codex.wordpress.org/Function_Reference/the_date