Monday, July 25, 2022
HomeWordPress Developmenttheme growth - ACF get_sub_field ALT TAG within the repeater would not...

theme growth – ACF get_sub_field ALT TAG within the repeater would not present


See right here for ACF picture docs.

https://www.advancedcustomfields.com/assets/picture/

If picture area is ready to return as an array you then want retailer the picture subfield right into a variable and use the variable to output the array keys.

So in your case, it will be like this…

<?php whereas( have_rows('logo_list') ) : the_row();?>
     <?php $picture = get_sub_field('picture'); ?>
     <li><img src="<?=$picture['url']?>" alt="<?=$picture['alt']?>" /></li>
<?php endwhile;?>

Use the code beneath inside your loop to dump your $picture variable information so you may see all of the picture sizes and different picture information.

echo '<pre>' . print_r($picture, true) . '</pre>';

Very unusual what is going on right here.

Earlier than your loop strive including this to see all the information within the area.

<?php world $put up; ?>
<?php $area = get_field('logo_list', $post->ID); ?>
<?php echo '<pre>' . print_r($area, true) . '</pre>'; ?>

Put up the output once you’ve carried out this.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments