Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @pdidee,
    I would think so, have you tried and had issues?

    Thread Starter PDidee

    (@pdidee)

    Can’t seem to get anything to load. Not sure if I need to set it as a repeater or a flexible. Either way nothing loads or is there. I’m hardcoding the shortcode within my custom page template like this:

    <?php if ( have_rows( 'page_builder' ) ): ?>
    	<?php while ( have_rows( 'page_builder' ) ) : the_row(); ?>
    <?php if ( get_row_layout() == 'endorsements' ) : ?>
    <!-- ENDORSEMENTS -->
    	<div id="endorsements">
    		<h2>Endorsements</h2>
    			<?php echo do_shortcode('[ajax_load_more preloaded="true" preloaded_amount="6" posts_per_page="6" scroll="true" button_label="Load More" button_loading_label="Loading..." acf="true" acf_field_type="repeater" acf_field_name="single_endorsement" container_type="div" css_classes="endo-flex" transition="fade"]'); ?>	
    				
    <?php endif; ?>
    			</div>
    			
    		<?php elseif ( get_row_layout() == 'chapter_download' ) : ?> ...

    And my repeater template in ALM like this:

    <article>
       <?php 
          $img = get_sub_field('img');
          $img = $img['sizes']['thumbnail']; 
       ?>
       <div class="single">
          <?php if ( $img ) { ?>
    	   <div class="left"><img src="<?php echo $img; ?>" alt="" /></div>
          <?php }?>
          <div class="right"><?php the_sub_field('copy');?></div>
       </div>
    </article>
    Plugin Author Darren Cooney

    (@dcooney)

    Now that I see the code, I don’t think it can work because ALM is not looking for nested rows, just top level.

    I’ll have to think of a way to handle this, but right now i’m not sure.

    Thread Starter PDidee

    (@pdidee)

    Okay thanks. Maybe we can convince the client to have the endorsements under theme options and we can pull them from there instead each time they use the template. Is that possible though?

    • This reply was modified 7 years, 7 months ago by PDidee.
    Plugin Author Darren Cooney

    (@dcooney)

    I think if you you pass ‘option’ as the acf_post_id shortcode value it should work. I haven’t tried though.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Repeater inside of a flexible field’ is closed to new replies.