Jump to content
php.lv forumi

Foreach ul srakstā horizontālu bildi novieto pa vidu


Recommended Posts

Sveiki! Kā būtu iespējams šo UL izkārtojumu iestutēt forech cilpā?

<ul class="rec-album-list">
	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>


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...