Support

Account

Home Forums Add-ons Gallery Field Image display issues

Unread

Image display issues

  • Hi everybody,

    I made a page where all the posts are visible and show my custom fields. Everything works well except the gallery. For some reason, at the load, I see all pictures of each gallery and if I change to an other browser tab and go back, I can see one picture only.

    I don’t understand why is doing this.

    You can have a look here.

    And here is the code here

    
    
    		<?php
    
    		// the query
    		$the_query = new WP_Query( array (    'category_name' => 'test-work' ) ); ?>
    
    		<?php if ( $the_query->have_posts() ) : ?>
    
    			<!-- pagination here -->
    
    			<!-- the loop -->
    			<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    				<div class="bloc <?php the_field('center_content'); ?>">
    				<?php if (get_field('centrage_image') ): ?>
    					<div class="works <?php the_field('centrage_image'); ?>">
    
    						<div class="works_img">
    title
    							<?php
    
    							$images = get_field('gallery2');
    
    							if( $images ): ?>
    							    <div id="slide" class="flexslider">
    							        <ul class="slides">
    							        <?php foreach( $images as $image ): ?>
    
    							            <li>
    							                <img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />
    							            </li>
    							        <?php endforeach; ?>
    							    </ul>
    							</div>
    
    						<?php endif; ?>
    
    							<!-- end slide -->
    
    							<?php
    								$image = get_field('image');
    								if( !empty($image) ): ?>
    
    								<div class="image_taff">
    									<img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />
    								</div>
    								<?php endif; ?>
    
    								<?php if (get_field('inprogress', get_the_id()) ): ?>
    
    								<div class="progress">
    									<img src="https://lesbandits.ch/lesbandits/wp-content/themes/panpan/img/les_bandits_etoile.svg" alt="En Cours" />
    								</div>
    							<?php endif; ?>
    
    								<?php if (get_field('informations') ): ?>
    
    						<div class="txt_infos">
    							<?php the_field('informations'); ?>
    						</div>
    
    					<?php endif; ?>
    
    					</div>
    
    					</div>
    				<?php endif; ?>
    				</div>
    
    			<?php endwhile; ?>
    			<!-- end of the loop -->
    
    			<!-- pagination here -->
    
    			<?php wp_reset_postdata(); ?>
    
    		<?php else : ?>
    			<p><?php esc_html_e( 'Désolé, rien ne correspond!' ); ?></p>
    
    	</article>
    
    <?php endif; ?>

    Many thanks for the help !

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.