Forum Replies Created

  • Yes your assumption is correct. Sorry if i am not explaining this well.
    Here is my code:

    <!-- Main Content -->
        <div class="large-12 columns" role="content" style="margin-top: 2em;">
    	<?php while ($portfolio->have_posts()) : $portfolio->the_post(); ?>	
    		<?php $pagename = get_query_var('name'); ?>
    		<div class="large-4 columns panel">
    			<h3><?php the_field('title'); ?></h3>
    			<?php the_field('description'); ?>
    			<a href="#" data-reveal-id="myModal"><?php the_post_thumbnail(); ?></a>
    		<div id="myModal" class="reveal-modal">
    			<?php $images = get_field('image_gallery');
    				if ( $images ):
    				echo "<h3>".$images['id']."</h3>";
    			<div class="flexslider">
    				<ul class="slides">
    					<?php foreach( $images as $image ): ?>
    					<li><img src="<?php echo $image['url']; ?>" /></li>
    					<?php endforeach; ?>
    			<?php endif; ?>
    	<?php endwhile; ?>
        <!-- End Main Content -->

    Basically I setup a while to check for the custom post type “portfolio” which in turn each post uses the ACF gallery field. I loop through and if there are posts, it posts them on the page. But for the gallery it seems to only do the last gallery of the most recent post, and it shows the same gallery for all the posts.

Viewing 1 post (of 1 total)