我对文件覆盖“blog_item.php”有疑问。我只想查看每个类别中的第一张图片,而没有介绍性文字。我能怎么做?我写了这段代码:
<?php
if (isset($images->image_intro) and !empty($images->image_intro))
{
$imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro;
$class = (htmlspecialchars($imgfloat) != 'none') ? ' class="size-auto align-'.htmlspecialchars($imgfloat).'"' : ' class="size-auto"';
$title = ($images->image_intro_caption) ? ' title="'.htmlspecialchars($images->image_intro_caption).'"' : '';
echo '<img'.$class.$title.' src="'.htmlspecialchars($images->image_intro).'" alt="'.htmlspecialchars($images->image_intro_alt).'" />';
}?>
<?php echo $this->$images->image_intro; ?>