Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code 1: https://wordpress.stackexchange.com/questions/307150/save-attachment-custom-fields-on-front-end?noredirect=1&lq=1
- --
- $vid_pix = get_post_meta($v_Id, 'vid_pix', false);
- if (!empty($vid_pix)) {
- foreach ($vid_pix as $vP) {
- $Pt = get_post_meta($vP, 'photo_time', true);
- $Por = get_post_meta($vP, 'photo_order', true);
- echo '<img src="' . wp_get_attachment_thumb_url($vP) . '" alt=""/>';
- echo '<input type="hidden" name="photo_order" class="photo_order" value="'.$Por.'" />';
- echo '<input type="text" name="photo_time" class="photo_time" value="'.$Pt.'"/>';
- }
- }
- Code 2: https://wordpress.stackexchange.com/questions/307065/change-order-of-images-attached-to-post?noredirect=1&lq=1
- --
- <div id="pic-con">
- <?php
- if (!empty($vid_pix)) {
- foreach ($vid_pix as $vP) {
- $filename = basename( get_attached_file( $vP ));
- echo '<div class="photo-upload-box">';
- echo '<img src="' . wp_get_attachment_thumb_url($vP) . '" alt=""/>';
- echo '<input type="hidden" class="pic_value" value="' . $filename . '" />';
- echo '<input type="hidden" name="'.$vP.'" class="orders" />';
- echo '</div>';
- }
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement