0

I have on my site some products. My plan is to show some deals. But I want to show also the published date of the deal, the date that i have published the deal. Like a blogpost shows the published date.

What code can i use and where can i add it?

Hope you can help me. The site is www.vakantie.guru, under accomodation there are some products where i refer to.

I have tried to find in the other files which cope is used for the blogpost date, thought that same code could be used. But I can't find it in the files

  • What have you tried? What exact problem are you having? Please edit your question to include any relevant code. – Pat J Aug 12 '19 at 21:11
  • I have tried to find in the other files which cope is used for the blogpost date, thought that same code could be used. But I can't find it in the files – Anushka27 Aug 13 '19 at 5:29
0
$post_id = 12;
echo get_the_date( 'Y-m-d',$post_id);
  • It's not a post, it's a product. Can this still be done as you mentioned? – Anushka27 Aug 13 '19 at 5:27
  • please use product id instead of post id – Wordpress Dev Aug 13 '19 at 5:35
  • Do I need to put the code in backend of the product or the php of the product? – Anushka27 Aug 13 '19 at 5:50
  • in product.php (code where you want to show) – Wordpress Dev Aug 13 '19 at 6:29
  • So i have done it, but i see the code on frontend. Doesn't work :( – Anushka27 Aug 13 '19 at 11:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.