Getting values from custom fields
-
I’m trying to make a movie review page and next to the title, I want to show just the value of my custom field. This is what I’ve put into WP:
Key: Rating
Value: (some image)Now, I’ve been reading this page to figure out how to do it, but no luck. I’ve tried to put in these two codes, but I get nothing in return:
<?php echo get_post_custom_values('rating'); ?> <?php echo get_post_meta($post->ID, 'rating', true); ?>
But again, neither one works. I can put in
<?php the_meta(); ?>
and it will print out the fields as a list, but I don’t want that.
I’ve been testing by putting in the code in just one post to see if it will work (since technically, it’s still in The Loop). What you see at the bottom is the result of the the_meta call I put in.
I’ve tried to do a search already in the WP forums, but no luck within the first few pages of my search. Any help with this is highly appreciated.
- The topic ‘Getting values from custom fields’ is closed to new replies.