I need to change the order of items in a listing. Which is decreasing and needs to change to growing.
It's a code not made by me, but I need to maintain it.
<div class="wrapper wrapper-noticia-listagem cf" data-rel-evento="noticias" <?php if($noticias_tag) { echo 'style="display: block;"'; } ?> >
<?php
foreach($noticias_tag as $noticia_tag) {
if(trim($noticia_tag['link_direto']) === "" or $noticia_tag['link_direto'] === null) {
$categoria_slug = $noticia_tag['categoria_slug'];
$noticia_slug = $noticia_tag['slug'];
$noticia_id = $noticia_tag['id'];
$link = "/noticias/$categoria_slug/$noticia_slug-$noticia_id";
$target = "";
} else {
$target = "target='_blank'";
$link = $noticia_tag['link_direto'];
}
?>
<p>
<strong>
<a href="<?php echo $link; ?>" <?php echo $target; ?>>
<?php echo $noticia_tag['titulo']; ?>
</a>
</strong><br>
<?php echo $noticia_tag['chamada']; ?>
<br> Enviada em
<?php echo datetimetostrd($noticia_tag['data_publicacao']); ?> - <a href="<?php echo $link; ?>" <?php echo $target; ?>>Leia mais</a>
</p>
<?php } ?>
</div>
So I understand, I need to create a variable that will grab the whole div that contains the news listing in p and there order via PHP.