Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I know similar questions have been asked dozens of times but I'm just not understanding how to display custom fields. I'm using woocommerce and want to display a custom field value on product pages.

I add the custom field "current_promotions" and a value to a product, and have tried adding this to the content-product.php template, but I'm getting nowhere:

<?php $postid = get_the_ID(); ?>

<?php get_post_meta($post_id, $key, $single); ?>
share|improve this question

1 Answer

up vote 0 down vote accepted

This should do it

<?php echo get_post_meta( get_the_ID(), 'current_promotions', true ); ?>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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