Support

Account

Home Forums General Issues Get_field, shortcode, nothing work, just display a word " array " Reply To: Get_field, shortcode, nothing work, just display a word " array "

  • I’m assuming that the repeater field name is video_y_chat. I changed the related lines in your code

    
    <?php
    /**
     * The Template for displaying all single posts.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    get_header(); ?>
    
        <div id="primary">
          <div id="content" role="main">
    
          
    
    <?php while ( have_posts() ) : the_post(); ?>
    
    <?php if( have_rows('video_y_chat') ): ?>
    
    	<ul class="slides">
    
    	<?php while( have_rows('video_y_chat') ): the_row(); 
    
    		// vars
    		$image = get_sub_field('image');
    		$content = get_sub_field('content');
    		$link = get_sub_field('link');
    
    		?>
    
    		<li class="slide">
    
    			<?php if( $link ): ?>
    				<a href="<?php echo $link; ?>">
    			<?php endif; ?>
    
    				<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" />
    
    			<?php if( $link ): ?>
    				</a>
    			<?php endif; ?>
    
    		    <?php echo $content; ?>
    
    		</li>
    
    	<?php endwhile; ?>
    
    	</ul>
    
    <?php endif; ?>
    
              
        <?php get_template_part( 'content-single', get_post_format() ); ?>
      
            <?php endwhile; // end of the loop. ?>
    
              <?php comments_template( '', true ); ?>
          </div><!-- #content -->
        </div><!-- #primary -->
    
    <?php get_footer(); ?>