Retrieving meta value from a post
-
i am trying to retrieve a custom field (an image in this case) from a specific post. I can bring the custom field in, but it’s not from the post I want. I have tried a few different options here, and I finally came up with this:
<?php query_posts('meta_key=post_image_value'); ?><h3><?php the_title(); ?></h3> <?php while (have_posts()) : the_post(); ?> <img src="<?php echo get_post_meta($post->ID = 23, "post_image_value", $single); ?>" <?php endwhile; ?>
Still not right, can anyone see what I am doing wrong here?
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Retrieving meta value from a post’ is closed to new replies.