Support

Account

Home Forums Add-ons Gallery Field Lightbox in gallery

Helping

Lightbox in gallery

  • Good afternoon! I apologize in advance for my bad English. I’m new to wordpress and I do not know much yet, but I need to have a lightbox open when I click on a picture in the gallery. Here is my code to output the gallery:

    <?php $images = get_field('slajdy');
    									
    if( $images ): ?>
    <div class="slider_">
    <div class="carousel_arrows"></div>
    <div class="slider_catalog">
    <?php foreach( $images as $image ): ?>
    										        <div class="slide">
    										            <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
    										        </div>     
    <?php endforeach; ?>
    </div>
    									    
    </div>    
    <?php endif; ?>

    I’m using the Sinple light box. What changes do I need to make in order for the lightbox to connect?
    Thank you in advance for your response!

  • UPD:
    I edit my code:

    <?php $images = get_field('slajdy');
    									if( $images ): ?>
    									<div class="slider_">
    										<div class="carousel_arrows"></div>
    									    <div class="slider_catalog">
    									        <?php foreach( $images as $image ):
    										        $content = '<div class="slide">';
    										        $content .= '<a class="gallery_image" href="<?php echo $image['url']; ?>">';
    										            $content .= '<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />';
    										        $content .= '</a>'; 
    										        $content .= '</div>';
    										        if ( function_exists('slb_activate') ){
    										        	$content = slb_activate($content);
    										        }
    										        echo $content;?>        
    										      <?php endforeach; ?>
    										    </div>
    									</div>    
    						    <?php endif; ?>

    But his don’t work =(

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Lightbox in gallery’ is closed to new replies.