How to display in the preview post all the images that are embedded in the post?

To do this you need preview format "Gallery"
Something like the code snippet template preview galleries already tweaked:

<div class="preview">
 <p class="thumb">
<a href="<?php the_permalink(); ?>">
<?php
$img = get_attached_media('image', $post--->ID); 
if ($img) {
 foreach ($img as $id => $attachment) {
$thumb = wp_get_attachment_image_src($id, 'pinthis', 'thumbnail') ?>
<img src="<?php echo $thumb[0]; ?>" alt="<?php the_title(); ?>">
<?php } }?>
</a>
</p>
 </div>


BUT it displays only one thumbnail and are not displayed all the images nested in a post.
All this is necessary to ensure that would preview the post to make a slider out. nested in the post images.

Help with code, please correct Hz that not so I do not understand
Thank you!

The template code preview Gallery format
<?php
 // get options
 $pinthis_pinbox_soc_icons = get_option('pbpanel_pinbox_soc_icons');
 $pinthis_pinbox_show_comments = get_option('pbpanel_pinbox_show_comments');
 $pinthis_pinbox_show_postdate = get_option('pbpanel_pinbox_show_postdate');
?>

<article class="pinbox">
 <div <?php post_class(); ?>>
 <?php if (is_sticky()) { ?>
 <span class="ribbon"><?php echo __('Sticky', 'pinthis'); ?></span>
 <?php } ?>
 <div class="preview">
 <p class="thumb">
<a href="<?php the_permalink(); ?>">
<?php
$img = get_attached_media('image', $post--->ID); print_r(get_attached_media('image', 2972));
if ($img) {
 foreach ($img as $id => $attachment) {
$thumb = wp_get_attachment_image_src($id, 'pinthis', 'img') ?>
<img src="<?php echo $thumb[0]; ?>" alt="<?php the_title(); ?>">
<?php } }?>
</a>
</p>
</div>
 <div class="title">
 <div class="post-thumb-popup"><span><?php echo $post--->ID; ?></span></div>
 <h2 class="title-2"><a class="popup-post-modal-open" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
</div>
 <div class="category"><?php the_category('&nbsp;'); ?></div>
 <div class="emf"><div class="emb"></div>
 <div class="meta-data">
 <?php if ($pinthis_pinbox_soc_icons == 1) { ?>
 <div class="top-bar">
 <ul class="social-media-icons clearfix">
 the <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo get_permalink(); ?>" class="border-color-3 icon-facebook tooltip" title="<?php echo __(", 'pinthis'); ?>" target="_blank"><?php echo __('Facebook', 'pinthis'); ?></a></li>
 the <li><a href="http://vk.com/share.php?url=<?php echo get_permalink(); ?>" class="border-color-3 icon-vkontakte tooltip" title="<?php echo __(", 'pinthis'); ?>" target="_blank"><?php echo __('VK', 'pinthis'); ?></a></li>
 the <li><a href="https://plus.google.com/share?url=<?php echo get_permalink(); ?>" class="border-color-1 icon-gplus tooltip" title="<?php echo __(", 'pinthis'); ?>" target="_blank"><?php echo __('Google+', 'pinthis'); ?></a></li>
 the <li><a href="https://twitter.com/share?url=<?php echo get_permalink(); ?>" class="border-color-4 icon-twitter tooltip" title="<?php echo __(", 'pinthis'); ?>" target="_blank"><?php echo __('Twitter', 'pinthis'); ?></a></li>
</ul>
</div>
 <?php } ?>
<span class="icon-total-comments"><?php comments_number('0', '1', '%'); ?></span>
<span class="icon-post-date"><?php echo get_the_date('d.m.y'); ?></span>
</div>
</div>
</div>
</article>
August 19th 19 at 22:50
1 answer
August 19th 19 at 22:52
Solution
Oban! IT! thanks But I'm bad looking, hell found - Anastacio commented on August 19th 19 at 22:55

Find more questions by tags PHPWordPress