Вот моя проблема, я должен отображать массив значений (описание) под фотографиями, как это:Проблемы в моем Еогеасп PHP
Вместо этого он появляется как этот
I Я работаю над этой проблемой, это мой текущий код:
if (preg_match_all('/<div id="description" class="description">([^<]*)<\/div>/', $content, $match)) {
for($i = 0; $i < count($match[0]); $i = $i+1) {
$description[] = $match[0][$i];
}
}
$attachments =& get_children($args);
$arrayMatches = array();
if ($attachments) {
foreach(array_chunk($attachments, 2) as $img) {
echo '<div class="two_cols">';
foreach($img as $attachment) {
foreach($attachment as $attachment_key => $attachment_value) {
$imageID = $attachment->ID;
$imageTitle = $attachment->post_title;
$imagearray = wp_get_attachment_image_src($attachment_value, $size, false);
$imageAlt = get_post_meta($imageID, '_wp_attachment_image_alt', true);
$imageURI = $imagearray[0]; // 0 is the URI
$imageWidth = $imagearray[1]; // 1 is the width
$imageHeight = $imagearray[2]; // 2 is the height
?>
<div class="col_1_2">
<div id="attachment_<?php echo $imageID; ?>" class="wp-caption alignnone" style="width: 356px;">
<a rel="lightbox-0" href="<?php echo $imageURI; ?>"><img class="wp-image-<?php echo $imageID; ?> size-full" title="<?php echo $imageTitle; ?>" src="<?php echo $imageURI; ?>" alt="<?php echo $imageAlt; ?>" width="456" height="304" /></a>
<p class="wp-caption-text"><?php echo $imageTitle; ?></p>
<?php
$arrayMatches[] = $match[0][$j];
?>
</div>
</div>
<?php
break;
}
$j++;
}
foreach(array_chunk($arrayMatches, 2) as $desc) {
echo '<div class="description">';
foreach($desc as $item) {
echo $item;
}
echo '</div>';
}
echo '</div>';
}
}
Я стараюсь так много решений, но никто не был хорошим. Спасибо за помощь;)
[Twitter самозагрузки] (http://getbootstrap.com/) делает этот вид дисплея легко. – JabberwockyDecompiler