Take the 2-minute tour ×
WordPress Development Stack Exchange 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 1

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

protected by Community Mar 20 at 19:23

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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