advanced custom field repeater
<?php
// check if the repeater field has rows of data
if( have_rows('repeater_field_name') ):
// loop through the rows of data
while ( have_rows('repeater_field_name') ) : the_row();
// display a sub field value
the_sub_field('sub_field_name');
endwhile;
else :
// no rows found
endif;
?><?php
$rows = get_field('repeater_field_name');
if($rows)
{
echo '<ul>';
foreach($rows as $row)
{
echo '<li>sub_field_1 = ' . $row['sub_field_1'] . ', sub_field_2 = ' . $row['sub_field_2'] .', etc</li>';
}
echo '</ul>';
}<?php
$rows = get_field('repeater_field_name');
if( $rows ) {
echo '<ul class="slides">';
foreach( $rows as $row ) {
$image = $row['image'];
echo '<li>';
echo wp_get_attachment_image( $image, 'full' );
echo wpautop( $row['caption'] );
echo '</li>';
}
echo '</ul>';
}
Also in PHP:
- buscar un substring dentro de un string php
- cart icon in woocommerce
- cacert file_get_contents openssl
- check if character in string php
- find array duplicates in two arrays php
- base64 php decode with password
- Warning: file_get_contents(): SSL operation failed with code 1
- 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
- artisan clear cache command
- create qr code png image of 200*200 using phpqrcode
- create seed file laravel
- echo console.log
- base64 encode and decode in php
- base64 php encode decode
- clear cache laravel ubuntu terminal
- date to string php
- codeigniter get num_rows
- SET CURRENT DATE TIME IN PHP'
- c date format php
- composer install in laravel project
- composer global in laravel means
- check char inside string php
- add one day to given date in php
- calculate total time from start and end datetime in php