Skip to content

Example: Get all images and display as thumbnails

sc0ttkclark edited this page Aug 7, 2012 · 4 revisions
<?php if ( is_array( $value ) ) : ?>
    <ul class="thumbnail-list">
        <?php foreach ( $value as $val ) : ?>
            <li>
                <a href="<?php echo $val[ 'guid' ]; ?>" title="<?php echo esc_attr( $val[ 'post_title' ] ); ?>" rel="item<?php echo $this->get_field( 'id ' ); ?>">
                    <img src="<?php echo wp_get_attachment_thumb_url( $val[ 'ID' ] ); ?>" alt="" />
                </a>
            </li>
        <?php endforeach; ?>
    </ul>
<?php endif; ?>