ziedinjsh Posted February 8, 2019 Report Share Posted February 8, 2019 Sveiki! Kā būtu iespējams šo UL izkārtojumu iestutēt forech cilpā? <ul class="rec-album-list"> <?php foreach($recs as $rec){ $table_images = $wpdb->prefix.'album_images'; $img = $wpdb->get_row("SELECT * FROM $table_images WHERE aid='".$rec->id."' AND imgid='".$rec->front_image."'"); if($img->orientation == 'vertical'){ $ver_image[] = wp_get_attachment_image($img->imgid, 'medium_large', '', ['class' => '']); }else if($img->orientation == 'horizontal'){ $hor_image[] = wp_get_attachment_image($img->imgid, 'medium_large', '', ['class' => '']); } } ?> <li class="rec-album rec-album-vertical"><?php echo $ver_image[0]; ?></li> <li class="rec-album rec-album-horizontal"><?php echo $hor_image[0]; ?></li> <li class="rec-album rec-album-vertical"><?php echo $ver_image[1]; ?></li> </ul> Quote Link to comment Share on other sites More sharing options...
aaxc Posted February 9, 2019 Report Share Posted February 9, 2019 Vai tas ir mājasdarbs? Quote Link to comment Share on other sites More sharing options...
yozhis Posted February 10, 2019 Report Share Posted February 10, 2019 foreach, endforeach Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.