First 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 -->