Support

Account

Forum Replies Created

  • John,

    Thanks for the reply. Works a treat!

    Thanks again.

  • Elliot,

    That’s great thank you.

  • 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

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