Custom Field Issue
-
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
https://localhost.com/images/58.gif
for instance.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="https://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
https://localhost.com/images/58.gif
is not being found despite the fact it is displayed when I view the Manage Post area.Any ideas?
- The topic ‘Custom Field Issue’ is closed to new replies.