Forum Replies Created
-
AuthorPosts
-
dawoodMemberok I got it figured out, I had the post meta, calling in the wrong id.. thanks Steve.
dawoodMemberthanks Steve, I tried it earlier but not dice. might be that I am getting variables mixed up?
`<?php
$image_ids = get_post_meta($post_id=’forms’, ‘my_image’);
foreach ($image_ids as $image)
{$myupload = get_post($image);
$title = $myupload->post_title;
$description = $myupload->post_content;
$caption = $myupload->post_excerpt;echo ‘title:’ . $title;
echo ‘description:’ . $description;
echo ‘caption:’ . $caption;echo ‘
‘;
print_r($myupload); // Displays all data
}
?>
dawoodMemberThanks Steve, am testing it right now and trying out all the fields! Though am stuck already.. 🙂
So I registered a field
// Upload Image / File piklist('field', array( 'type' => 'file' ,'field' => 'my_image' ,'label' => 'Upload image' )); and am trying to call it to my single.php but for some reason i can't seem to get it<?php foreach ($image_ids as $image) { $image_ids = get_post_meta($post_id, 'my_image'); $myupload = get_post($image); $title = $myupload->post_title; $description = $myupload->post_content; $caption = $myupload->post_excerpt; echo 'title:' . $title; echo 'description:' . $description; echo 'caption:' . $caption; echo '<img src="' . wp_get_attachment_url($image) . '" />'; print_r($myupload); // Displays all data } ?> -
AuthorPosts