Advanced Custom Fields Demo

See what you can build with ACF

This page was created based on a tutorial from Tribeswell.com.

  • Home
  • Custom Home Page-EC
    • Code for Custom Home Page
  • ACF Galleries
    • ACF Gallery Slider
      • Gallery Slider Page Template Code
    • Page with Magnific Popup Gallery
  • Flexible Content Layouts
    • Flexible Content Full-Width Page
    • Checkerboard Page
  • Create a Post
    • Front-End Posting and Editing
  • Blog
You are here: Home / Page with Magnific Popup Gallery

Page with Magnific Popup Gallery

More photos from Magdeleine to illustrate the Magnific Popup Gallery.

I’m not going to duplicate everything in the tutorial from Tribeswell here, but I made enough modifications to the page template that this might be useful.


/*
Template Name: Page with Magnific Gallery
*/

add_action('genesis_entry_content', 'magnific_gallery_loop', 8);
function magnific_gallery_loop() {
  $images = get_field('image_gallery'); 
  if($images):
      echo '<div class="popup-gallery">';
            foreach( $images as $image ): 
                echo '<a href="'.$image['url'].'" class="lightbox-link" title="'. $image['caption'].'" data-description="'.$image['description'].'">';
                   echo '<div class="image-wrap"><img src="'.$image['url'].'"></div></a>';
            endforeach; 
      echo '</div>';

  endif;
}

genesis();

Search

Copyright © 2023 · Genesis Sample Theme on Genesis Framework · WordPress · Log in