I'm setting up an Index and I'm trying to do the following ... I'm going to have this 'mini highlight' and at the moment I was able to sort it for DATE only, but sometimes the news will be updated and I would like this news to rise based on TBM on the modification date. Here is the code for you to analyze!
<div class="news-wrap" id="news-section">
<div class="row">
<div class="col-md-4">
<section class="news">
<h4 class="section-title">
<a href="<?= get_site_url(null, 'category/eventos-e-lazer') ?>" target="_self">Eventos</a>
</h4>
<?php
$posts = get_posts(array(
'numberposts' => 4,
'post_type' => 'post',
'category_name' => 'eventos-e-lazer',
'orderby' => 'date',
'order' => 'DESC'
));
$count = 0;
foreach ($posts as $post):
setup_postdata($post);
if($count == 0): ?>
<article class="news-destaque">
<a href="<?php the_permalink(); ?>">
<figure>
<img src="<?php the_post_thumbnail_url($post->ID, 'ag-apcef-large'); ?>" alt="<?php the_title(); ?>">
</figure>
<div class="title"><?php the_title(); ?></div>
</a>
<div class="content">
<?php the_excerpt(); ?>
</div>
<a href="<?php the_permalink(); ?>" class="link">Leia mais</a>
</article>
<?php else: ?>
<article class="news-reduced">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</article>
<?php endif;
$count++;
endforeach; ?>
</section>
<a href="<?= get_site_url(null, 'category/eventos-e-lazer') ?>" class="btn-list-all" target="_self">Veja todos</a>
</div>