i need call size ... add_image_size( 'sami_post_standard', 760, 400, true); in meta box .............................................................. ..............................................................
this meta box code
/** * post type gallery */ $meta_boxes['metabox-post-gallery'] = array( 'id' => 'metabox-post-gallery', 'title' => __( 'gallery settings', 'sami' ), 'pages' => array( 'post', ), 'context' => 'normal', 'priority' => 'high', 'show_names' => true, 'fields' => array( array( 'name' => __( 'slider images', 'sami' ), 'desc' => __( 'upload gallery slider images.', 'sami' ), 'id' => $prefix . 'gallery_slider', 'type' => 'file_list', 'preview_size' => array( 100, 100 ), ), ), );
///////////////////////// in single.php file call /////////////////////////
$gallery_slider = get_post_meta( $post->id, 'sami_gallery_slider', true ); <div class="slider_post"> <div class="post_silder"> <ul id="post-slid-post"> <?php foreach ( $gallery_slider $gallery_slider ) { echo "<li>"; echo '<div class="item"><img src="'. esc_url($gallery_slider) .'" alt="'. esc_attr(get_the_title()) .'"></div>'; echo "</li>"; } ?> </ul> </div> </div>
this solution
<?php if ( $gallery_sliders ) { foreach ( $gallery_sliders $attachment_id => $img_full_url ) { echo "<li>"; echo '<div class="item">'. $full = wp_get_attachment_link($attachment_id, 'ashmawi_post_standard'); echo esc_url($full[0]) .'</div>'; echo "</li>"; } } ?>
Comments
Post a Comment