Advance image is not showing up
- This topic has 2 replies, 2 voices, and was last updated 7 years, 3 months ago by
alisha.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
February 1, 2018 at 7:56 PM #8429
alisha
ParticipantFirst of all,
Thanks for making this awesome plugin.
I have created a group field using following codes:// Gallery Post Options $meta_boxes[] = array( 'id' => 'goalkick_format_gallery', 'title' => __( 'Gallery Post Options', 'goalkick' ), 'post_types' => array( 'post' ), 'context' => 'normal', 'priority' => 'high', 'autosave' => true, 'fields' => array( array( 'name' => __( 'Gallery Images', 'goalkick' ), 'id' => "{$prefix}post_gallery", 'type' => 'group', 'clone' => true, 'fields' => array( array( 'name' => 'Gallery Image', 'id' => "{$prefix}post_gallery_images", 'type' => 'image_advanced', 'max_file_uploads' => 1, ), array( 'name' => 'Image Description', 'id' => "{$prefix}post_gallery_images_des", 'type' => 'text', ), ), ), ) );
And I am using following codes to show the contents,text is showing up perfectly but the problem is image.It is not showing up.I have tried using three options but no positive result.Please help me.
<article id="post-<?php the_ID(); ?>" class="news-post-box col-md-4"> <?php $group = get_post_meta( get_the_ID(), 'football_post_gallery', true ); if( $group ) { ?> <div class="post-media"> <div class="post-gallery-wrapper "> <ul class=""> <li> <span> <?php foreach ( $group as $group ) { $heading = isset( $group['football_post_gallery_images_des'] ) ? $group['football_post_gallery_images_des'] : ''; echo $heading; } ?> </span> <span> <?php foreach ( $group as $group ) { $images = isset( $group['football_post_gallery_images'] ) ? $group['football_post_gallery_images'] : array(); foreach ( $images as $image ) { //option one $image_info = RWMB_Image_Field::file_info( $image, array( 'size' => 'featured-full' ) ); echo '<img src="' . $image_info['url'] . '" width="' . $image_info['width'] . '" height="' . $image_info['height'] . '" />'; //option two echo '<img src="' . wp_get_attachment_image_url( $image, 'featured-full' ) . '" />'; //option three echo wp_get_attachment_image( $image["ID"], "featured-full" ); } } ?> </span> </li> </ul> </div> <?php } ?> </div><!-- End .post-media --> </article><!-- post-box end -->
February 3, 2018 at 3:54 PM #8438Tu Duong
ParticipantHello,
Have you checked the code you send, then see the image displayed normally,
Only the 3rd image is wrong because you have the wrong one.
I send you 3 photos you checked, you check back1: add metabox
https://prnt.sc/i9hss12: code show image + error image 3rd
https://prnt.sc/i9hqs63: frontend
https://prnt.sc/i9hqg9February 3, 2018 at 10:16 PM #8439alisha
ParticipantIt was my mistake.I used the group variable for one time and foreach loop for two times.That's why it was not working.Thanks
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Advance image is not showing up’ is closed to new replies.