• I’m working on a custom post type called Movie.
    I enabled post format so that I can use Gallery Post Format.

    Now, in my single-movie.php I need to get images uploaded in gallery in Gallery Post Format. I’m using this snip

    <!-- Gallery immagini -->
    <div class="live-gallery">
    <?php
    $gallery = get_post_gallery_images(get_the_ID());
    foreach($gallery as $img) :
    ?>
    <a href="<?php echo get_permalink(get_the_ID()); ?>">
        <img src="<?php echo $img; ?>" alt="<?php echo get_the_title(); ?>" />
    </a>
    <?php endforeach; ?>
    </div>
    <!-- fine Gallery -->

    But I get only images from galleries I create inside the content, while I need images uploaded with specific field before the post content, when I select Gallery as post format.

    How can I fix this?
    Thanks in advance

The topic ‘Get images from gallery post format’ is closed to new replies.