Tagged: image
- This topic has 4 replies, 2 voices, and was last updated 7 years, 8 months ago by
vincire.
-
AuthorPosts
-
-
May 28, 2014 at 8:49 am #1757
vincireMemberHi, how do I get an image displayed on a page?
I have read through the forum and codex pages but can’t figure it out.I have used this to create the cpt image upload:
` piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘portret’
,’scope’ => ‘post_meta’
,’label’ => __(‘Voeg een portretfoto toe.’,’piklist’)
,’description’ => __(‘U kunt een foto uit de mediatheek kiezen of uw eigen uploaden’,’piklist’)
,’options’ => array(
‘modal_title’ => __(‘Kies hieronder een foto of kies voor Bestanden uploaden’,’piklist’)
,’button’ => __(‘Add’,’piklist’)
)
));What should I use in a template to get the image displayed?
-
May 28, 2014 at 2:57 pm #1760
SteveKeymaster@vincire– Let me know if this helps: http://piklist.com/user-guide/tutorials/displaying-images-upload-field/
-
May 30, 2014 at 4:14 am #1772
vincireMemberHi Steve, thank you for your answer.
The images still is’nt displayed. My knowledge of PHP is not sufficient to solve this.
I have this to display the image uploaded with the cpt code above:<?php $image_ids = get_post_meta($post_id, 'portret'); 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; print_r($myupload); // Displays all data } ?> -
May 30, 2014 at 1:27 pm #1775
-
June 3, 2014 at 3:16 am #1786
vincireMemberOk I will try this.
Thank you
-
-
AuthorPosts
- You must be logged in to reply to this topic.