• Resolved et3rnal

    (@et3rnal)


    Hi

    Sorry if this sound stupid! ??

    this is my code now

    <?php foreach( get_uf_repeater( 'clients' ) as $document_files ): extract( $document_files ) ?>
    <div class="ui-grid-a my-breakpoint">
    	<div class="ui-block-a"><a href="<?PHP echo $website_url ?>" target="_blank"><img src="<?php echo $project_image ?>" title="Project image" /><div><?php echo $project_detailes ?></div></a></div>
    	<div class="ui-block-b"><a href="<?PHP echo $website_url ?>" target="_blank"><img src="<?php echo $project_image ?>" title="Project image" /><div><?php echo $project_detailes ?></div></a></div>
    </div>
    <?php endforeach ?>

    What I need to do is, to have the second line with second value in the array instead of repeating the first one

    I tired to make the loop nested didn’t make it to work

    thanks

    https://www.ads-software.com/plugins/ultimate-fields/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Radoslav Georgiev

    (@radogeorgiev)

    Hi et3rnal,

    the question does not sound stupid,but I’m not sure what fields are you using in that repeater.

    Can you please paste the PHP export of the container so I can know what data are you storing and then trying to process.

    Best regards,
    Rado

    Thread Starter et3rnal

    (@et3rnal)

    Hi Radoslav, thanks for the quick respond and the amazing plugin, I got help from stackoverflow by using array_chunk which works just great

    <?php foreach (array_chunk(get_uf_repeater( 'clients' ), 2, true) as $array) { ?>
    	<div class="ui-grid-a my-breakpoint">
    		<?php foreach($array as $document_files) { ?>
    			<?php extract( $document_files ); ?>
    			<div class="ui-block-b"><a href="<?PHP echo $website_url ?>" target="_blank"><img src="<?php echo $project_image ?>" title="Project image" /><div><?php echo $project_detailes ?></div></a></div>
    		<?php } ?>
    	</div>
    <?php } ?>

    I’m repeating 2 text and 1 file(as url)

    thanks again

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to get 2 values at the time in repeater’ is closed to new replies.