add post meta value

Question

I am trying to add post-meta value and after this update query and after this get_post_meta value . but add_post_meta does not work .

<?php add_post_meta($post_id, 'Product_Year', trim( $_POST['Product_Year'])); ?>
  <?php update_post_meta($post_id, 'Product_Year', trim( $_POST['Product_Year'])); ?>

echo $year=get_post_meta($post_id , 'Product_Year',true );
0
sanjay 5 months 2020-12-21T05:10:39-05:00 0 Answers 6 views 0

Leave an answer

Browse
Browse