• I have i written code that show a list of images, under the featured image.. i want to add a previous and next link to the left and the right of featured image that can make go ahead and previous the image that’s shown..

    this is my code:

    <?php $images = get_post_meta( get_the_ID(), REALIA_PROPERTY_PREFIX . 'gallery', true ); ?>
    
    <?php if ( ! empty( $images ) ) : ?>
    	    <div class="col-sm-12 col-md-7">
    	        <div class="property-gallery">
    	            <div class="property-gallery-preview">
    
    	            	<?php $first_value = reset( $images ); ?>
    	            	<?php $first_key = key( $images ); ?>
    
    	                <a href="<?php echo esc_url( $first_value ); ?>" rel="property-gallery">
    
     			        <?php if ( $is_featured && $is_reduced ) : ?>
    				            <span class="property-badge"><?php echo __( 'Featured', 'realia' ); ?> / <?php echo __( 'Reduced', 'realia' ); ?></span>
    				        <?php elseif ( $is_featured ) : ?>
    				            <span class="property-badge"><?php echo __( 'Featured', 'realia' ); ?></span>
    				        <?php elseif ( $is_reduced ) : ?>
    				            <span class="property-badge"><?php echo __( 'Reduced', 'realia' ); ?></span>
    				        <?php endif; ?>
    
    <div id="property-gallery">
        <img id="image" src="<?php echo esc_url( $first_value ); ?>"  />
    </div>
    
    				        <?php if ( $is_sticky ) : ?>
    				            <span class="property-badge property-badge-sticky"><?php echo __( 'TOP', 'realia' ); ?></span>
    				        <?php endif; ?>
    	                </a>
    
    	            </div><!-- /.property-gallery-preview -->
    
    	            <?php if ( count( $images ) > 1 ) : ?>
    		            <div class="property-gallery-list-wrapper">
    		                <div class="property-gallery-list">
    
    				<?php foreach ( $images as $id => $url ) : ?>
    				                <li class="property-gallery-list-item <?php if ( $id == $first_key ) : ?>active<?php endif; ?>">
    				                    <a href="<?php echo esc_url( $url ); ?>" rel="property-gallery" class="ignore-colorbox" onclick="active">
    				                        <?php echo wp_get_attachment_image( $id, 'thumbnail' ); ?>
    
    				                    </a>
    				                </li>
    
    			            <?php endforeach; ?>
    
    <!-- Close all div -->

    CAN SOMEONE HELP ME, PLEASE?

  • The topic ‘How can i do a slider with some image of my gallery?’ is closed to new replies.