вот код новостей:
<?php
session_start();
require «functions/function.php»;
require «vendor/config.php»;
include «header.php»;
?>
<div class=«content d-flex flex-column flex-column-fluid bg-dark» id=«kt_content»>
<div class=«d-flex flex-column-fluid bg-dark»>
<div class=«container bg-dark»>
<div class=«row»>
<?php
$sql = $link->prepare(«SELECT * FROM news
»);
$sql->execute();
$new = $sql->fetchAll();
foreach ($new as $news):?>
<div class=«col-xl-4 bg-dark»>
<div class=«card card-custom gutter-b bg-dark»>
<div class=«card-header border-0 pt-8 text-center bg-dark»>
<h3 class=«card-title font-weight-bolder bg-dark»><img src=«<?php echo $news['image'];?>» width=«268px» height=«188px»></h3>
</div>
<div class=«card-body d-flex flex-column bg-dark»>
<div class=«flex-grow-1 text-center bg-dark»>
<h3 class=«card-title font-weight-bolder bg-dark»><?php echo $news['title']?></h3>
</div>
<div class=«pt-5»>
<div class=«mb-5» data-scroll=«true» data-height=«70»>
<p class=«text-center font-weight-normal font-size-lg pb-7»><?php echo $news['description']?></p>
</div>
<hr>
<a href=«fullstory.php?id=<?php echo $news['id']?>» class=«btn btn-primary btn-shadow-hover font-weight-bolder w-100 py-3»>Открыть</a>
</div>
</div>
</div>
</div>
<? endforeach; ?>
<?php if(empty($news)): ?>
<div class=«col-xl-12 col-xxl-12»>
<div class=«alert alert-custom alert-light-primary fade show mb-4» role=«alert»>
<div class=«alert-icon»>
<i class=«flaticon-exclamation»></i>
</div>
<div class=«alert-text»>На данный момент нет новостей</div>
<div class=«alert-close»>
<button type=«button» class=«close» data-dismiss=«alert» aria-label=«Close»>
<span aria-hidden=«true»>
<i class=«ki ki-close»></i>
</span>
</button>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>