John,
Thanks for the reply. Works a treat!
Thanks again.
That’s great thank you.
I am using the following solution after experimenting:
<?php
$images = get_field( 'gallery' );
if( $images ): ?>
<?php foreach( $images as $image ): ?>
<?php $image_large = wp_get_attachment_image_src($image['id'], 'large'); ?>
<?php $image_thb = wp_get_attachment_image_src($image['id'], 'thumbnail', $image['caption']); ?>
<div class="eventGal">
<a href="<?php echo $image_large[0]; ?>" rel="lightbox[gallery]">
<img src="<?php echo $image_thb[0]; ?>" class="attachment-thumbnail" /></a>
<h3><?php echo $image['title'];?></h3>
<p><?php echo $image['caption']; ?></p>
</div>
<?php endforeach; ?>
<?php endif; ?>
Thanks for your help
Thank you, I have used the following to get the required results:
<?php if(get_field('currentShows', $post->post_parent)) { ?>
<?php while(has_sub_field('currentShows', $post->post_parent)): ?>
<li><a href="<?php the_sub_field('currentLink'); ?>"><?php the_sub_field('currentLinkText'); ?></a></li>
<?php endwhile; ?>
<?php }
else {
echo 'Coming soon';
} ?>
Thanks
I have tried the above but I am not having much success.
I am using a repeater field but want the same results (display parent values on a sub page).
The code I am using on the parent page is:
<?php
$rows = get_field('currentShows');
if($rows)
{
foreach($rows as $row)
{ ?>
<li>
<a href="<?php echo $row['currentLink']; ?>">
<?php echo $row['currentLinkText']; ?>
</a>
</li>
<?php
} //end for
}// endif
else {
echo 'Coming soon';
}
?>
Any help much appreciated.
Thanks
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!
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.