Forum Replies Created
-
AuthorPosts
-
September 25, 2015 at 3:25 pm in reply to: CPT with multiple featured images and attached images #4393
Web GuyMemberNoticing some weird behavior using ‘upload media’ as follows…
piklist('field', array( 'type' => 'file' ,'field' => 'upload_media' ,'scope' => 'post_meta' ,'label' => __('Add \'In The News\' Images','products') ,'options' => array( 'modal_title' => __('Add File(s)','products') ,'button' => __('Add','products') ) ));The images appear and can be managed in the admin, but when I try to display them I can only get five to populate using this code…
<?php if ( $post->post_type == 'products' && $post->post_status == 'publish' ) { $attachments = get_posts( array( 'post_type' => 'attachment', 'exclude' => get_post_meta($post->ID, '_thumbnail_id', false ) ) ); if ( $attachments ) { foreach ( $attachments as $attachment ) { $class = "post-attachment mime-" . sanitize_title( $attachment->post_mime_type ); $thumbimg = wp_get_attachment_link( $attachment->ID, 'thumbnail-size', true ); echo '<li style="display:inline" class="' . $class . ' data-design-thumbnail">' . $thumbimg . '</li>'; } } } ?>Also, it seems that I can’t use the Add button in the upload field to attach existing images from the media library. I have to actually upload them. Is this normal?
September 21, 2015 at 11:45 am in reply to: CPT with multiple featured images and attached images #4373
Web GuyMemberMY BAD! Attached images already work just like I want them to. Piklist is AMAZING!
September 20, 2015 at 6:25 pm in reply to: CPT with multiple featured images and attached images #4370
Web GuyMemberSo far, so good!
I can upload multiple Featured Images and attach images to my CPT.
How can I display the attached images in the admin? I see code for
displaying them in the fronted, but that won’t work in admin, right?In addition to displaying the attached images, any way to delete them
individually like with Featured Images?Featured Images work SO well, attached ones are jealous!
September 19, 2015 at 8:40 am in reply to: CPT with multiple featured images and attached images #4365
Web GuyMemberThanks! I’ll let you know how it works!
September 18, 2015 at 5:22 pm in reply to: CPT with multiple featured images and attached images #4359
Web GuyMemberSteve
So I hope you’re saying I can use the same ‘upload field’ code for both
image attachments, as well as multiple featured images.Citing code on:
https://piklist.com/2013/08/01/v0-8-0-beta-2-and-file-upload-field-with-a-surprise-inside/Attaching images…
piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘upload_media’
,’scope’ => ‘post_meta’
,’label’ => ‘Add File(s)’
,’options’ => array(
‘title’ => ‘Add File(s)’
,’button’ => ‘Add’
)
));Multiple Featured Images
piklist(‘field’, array(
‘type’ => ‘file’
,’field’ => ‘_thumbnail_id’ // changed for thumb
,’scope’ => ‘post_meta’
,’label’ => ‘Add File(s)’
,’options’ => array(
‘title’ => ‘Add File(s)’
,’button’ => ‘Add’
)
));September 17, 2015 at 8:32 pm in reply to: CPT with multiple featured images and attached images #4350
Web GuyMemberIn the upload demo, I see this… “Validation rule set: Upload no more than two files.”
Specifically, I need to upload multiple — more than 2 — “Featured Images” as in…
https://piklist.com/2013/08/01/v0-8-0-beta-2-and-file-upload-field-with-a-surprise-inside/
Looks like there was some issues. Are they resolved?
Web GuyMemberPerfect!
BTW, I recently struggled trying to fine tune the order of meta boxes on a CPT admin page. Is there anything Piklist can do to modify the order of meta boxes?
-
AuthorPosts