I´m trying to implement the gallery add-on together with the Magnific Pop up http://dimsemenov.com/plugins/magnific-popup/
But to no avail.
What I have is a “single.php” page that has this code on the loop:
<?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
and then in the “content-gallery.php” page I have this:
<?php $images = get_field('Gallery'); if( $images ): ?> <ul class="gallery-link"> <?php foreach( $images as $image ): ?> <li> <a href="<?php echo $image['url']; ?>"><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" title="<?php echo $image['caption']; ?>" /></a> </li> <?php endforeach; ?> </ul> <?php?>
The magnific pop up just needs <ul class=”gallery-link”> so the problem seems to be in the gallery.
This is not working and I can´t see where the problem is.
Any help is welcome!
I am not able to see my images on front end..
can you plz help me
Thanks for the info.
In the end it was some closing tabs problem.
This is the final working code:
<?php $images = get_field('gallery');?> <ul class="gallery-link"> <?php foreach( $images as $image ): ?> <li> <a href="<?php echo $image['url']; ?>"> <img src="<?php echo $image['url']; ?>"> </a> </li> <?php endforeach; ?> </ul>
Thanks for the response let me check it …. 🙂
Sorry but just want to ask you one more thing …. are you suggested this code for this page only or anywhere ese I missed this code…. http://rdesignworks.edesignerz.com/#!/project_category/arts/
because when I tested another category i faced the same issue as image is not displaying on any of page……
i want more question on what page i need to make any code change if my image is not appearing on front end plz
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2020 Advanced Custom Fields. Subscribe