Add product post date in woocommerce
-
I started a woocommerce store and I’m looking to add product publish dates to the items I post. Currently, using a Kadence theme. I used the code below and it worked great. However, I’m looking to make the dates align flush at the bottom/center of the posts. How would I go about doing this? Thank you.
//WooCommerce Shop Page : Show Product Published Date add_action( 'woocommerce_after_shop_loop_item', 'wc_shop_page_product_date', 100 ); function wc_shop_page_product_date() { echo the_date('', '<span class="date_published">Published on: ', '</span>', false); } //WooCommerce Single Page : Show Product Published Date add_action('woocommerce_single_product_summary','wc_single_page_product_date',25); function wc_single_page_product_date() { if (is_product() ) { echo the_date('', '<span class="date_published">Published on: ', '</span>', false); } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add product post date in woocommerce’ is closed to new replies.