Forked from Goodvalley-CameraSki/single-images.php
Last active
November 2, 2016 19:10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$images = get_post_meta( get_the_ID(), 'images', true ); | |
if ( $images ) { | |
for( $i = 0; $i < $images; $i++ ) { | |
$image_name = get_post_meta( get_the_ID(), 'images_' . $i . '_image_name', true ); | |
$image_path = get_post_meta( get_the_ID(), 'images_' . $i . '_image_path', true ); | |
$class = 0 == $i || 0 == $i % 4 ? 'one-fourth first' : 'one-fourth'; | |
echo '<div class="' . $class . '"><p class="images"><img src="' . esc_url( $DOCUMENT_ROOT . $image_path ) . '" alt="Image 1" width="100%" align="middle" class="some-class" /></p>' . esc_html( $image_name ) . '</div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment