Hello. I am trying to make use of custom fields in my blog. In my post, I have a field called: price, with a value of '$17'. I set this particular value up for testing purposes. Anyway: I want to display this meta information in two places, the first place is where the post appears on my index.php page, and the second is below my actual post in the single page (single.php) thing. I am trying to somewhat hard code this into my theme, but I'm running into trouble.
Right now, on the index I have this code trying to display the meta information.
<strong>Price: </strong> <?php echo get_post_meta($post_id->ID, "price", $single = true) ?>
As far as I know this looks fairly correct. However, I'm going to assume that the code is not properly grabbing a post id to retrieve meta data from. my question is, how do I fix it so it outputs my price value stored?
Let me know if I should post more information.
EDIT: Code looks like htis now: <strong>Price: </strong> <?php $price = get_post_meta($post_id->ID, "price", $single = true); echo $price; ?>.