Basically I have created a new Custom Field called ‘postimage’ which stores the URL of an image which I would like to use unique to that post. Stores as a value such as
I am using the below code and get_post_meta template tag to extract the information necessary but am going wrong somewhere:
<div class="categoryimage"><a href="<?php the_permalink() ?>" rel="category tag" title="Image of '<?php the_title(); ?>'"><img src="<?php get_post_meta($post->ID, "postimage", true); ?>" alt="Post Image" class="catimage" /></a></div>
This code is placed within The Loop, yet whenever I try to view a post the following output is produced, as an example:
<div class="categoryimage"><a href="http://localhost/?p=58" rel="category tag" title="Image of 'Syndicate!'"><img src="" alt="Post Image" class="catimage" /></a></div>
Where basically the “postimage” custom field of
http://localhost.com/images/58.gifis not being found despite the fact it is displayed when I view the Manage Post area.
- The topic ‘Custom Field Issue’ is closed to new replies.