如果要呈现的文章也是如此,我如何将自定义class =“featured”添加到html \ com_content \ category \ _blog_item.php中?
是否有一行代码可以确定文章是否有特色?
谢谢!
答案 0 :(得分:1)
好的,我知道了!
进入html \ com_content \ category \ blog.php
将这一行粘贴在第79行
<?php
$featuredclass = '';
$item = &$item;
if ($item->featured == 1) {
$featuredclass = 'featured';
}
?>
并添加
<?php echo $featuredclass;?>
第86行
<div class="items-row cols-<?php echo (int) $this->columns;?> <?php echo 'row-'.$row ; ?>">
所以它看起来像这样:
<?php
$featuredclass = '';
$item = &$item;
if ($item->featured == 1) {
$featuredclass = 'featured';
}
?>
<div class=" <?php echo $featuredclass;?> items-row cols-<?php echo (int) $this->columns;?>
<?php echo 'row-'.$row ; ?>">
特别感谢Bojcheski