Support

Account

Home Forums Add-ons Repeater Field Large amount of repeater instances not loading back end

Unread

Large amount of repeater instances not loading back end

  • Hello,
    I have built a website for a school.
    One of the pages lists all the school’s teachers.
    It’s built with ACF, each teacher has an image, name, role, email an phone number (5 fields per teacher).
    There are 100 teachers in the school, when the editor has more than 50 repeater instances on the page, the admin page with the custom fields won’t load.
    On the front end, the page is shown.
    How can I make the backend work with this amount of fields? (100 teachers, each teacher with 5 fields = 500 fields)
    This is the code currently used to show the fields:

    
       <?php // check for rows (parent repeater)
    	if( get_field('staff') ): ?>
    	  <div id="staff">
    		<?php 	// loop through rows (parent repeater)
    	 	while( has_sub_field('staff') ): ?>
    		<div class="section">
    		<h3><?php the_sub_field('title'); ?></h3>
    		<?php 	// check for rows (sub repeater)
    		 if( get_sub_field('items') ): ?>
    			<?php 	// loop through rows (sub repeater)
    			while( has_sub_field('items') ): 
     			// display each item as a list - with a class of completed ( if completed )	?>
    			<div class="item">
                              <div class="portrait">
                            <?php $image = wp_get_attachment_image_src( get_sub_field('image'), 'staff-portrait' ); ?>
    <?php if (get_sub_field('image')): ?>
    <img src="<?php echo $image[0];?>" alt="<?php echo get_the_title(get_sub_field('image'))?>" />
    <?php endif; ?>
    </div>
    <div class="data">
                         <h4 ><?php the_sub_field('name'); ?></h4>
                         <span><?php the_sub_field('role'); ?></span>
                         <?php if (get_sub_field('email')) : ?>
                           <span><a href="mailto:<?php the_sub_field('email'); ?>">שליחת מייל</a></span>
                           <?php endif;?>
                            <span><?php the_sub_field('phone'); ?></span>
    			</div>					
    		        	</div>       
    				<?php endwhile; ?>
    				<?php endif; //if( get_sub_field('items') ): ?>				</div>	
     
    				<?php endwhile; // while( has_sub_field('staff') ): ?>	</div>
    			<?php endif; // if( get_field('staff') ): ?>
    

    Thanks,
    Dan

Viewing 1 post (of 1 total)

The topic ‘Large amount of repeater instances not loading back end’ is closed to new replies.