0

I am doing this tutorial: https://piklist.com/user-guide/tutorials/displaying-images-upload-field/

After creating this for a custom post type:

// Upload Image / File
  piklist('field', array(
  'type' => 'file'
  ,'field' => 'my_image'
  ,'label' => 'Upload image'
));

I then follwed by doing this

$image_ids = get_post_meta($post_id, 'my_image');
but now I am trying to call:

 print_r($image_ids);

and no array gets output.

what am I doing wrong? How do I get the images uploaded in the custom postype?

1 Answer 1

0

hey try to use this i think it work fine

$image_ids = get_post_meta(get_the_ID(), 'my_image');   
print_r($image_ids);
1
  • that and this $post->ID works as well, any ideas why the other one does not
    – user5288
    Dec 10, 2014 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.