3,
‘ignore_sticky_posts’ => true,
) );
set_transient( ‘jmb_top_news’, $top_posts, 15 * MINUTE_IN_SECONDS );
}
if ( $top_posts->have_posts() ) :
$count = 0;
echo ‘
while ( $top_posts->have_posts() ) : $top_posts->the_post();
$count++;
$article_class = ( 1 === $count ) ? ‘main-hero’ : ‘secondary-hero’;
?>
‘hero-img’, ‘alt’ => esc_attr( get_the_title() ) ) );
}
?>
name ) : esc_html__( ‘Destaque’, ‘jornal-mais-brasil-v2’ );
?>
< class=”hero-title”>
‘offset’ => 3,
‘ignore_sticky_posts’ => true,
) );
if ( $feed_posts->have_posts() ) :
while ( $feed_posts->have_posts() ) : $feed_posts->the_post();
?>
name ) : esc_html__( ‘Notícias’, ‘jornal-mais-brasil-v2’ );
?>
array( ‘titulo’ => ‘Cidades’, ‘slug’ => ‘cidades’, ‘classe_cor’ => ‘border-azul’ ),
array( ‘titulo’ => ‘Entretenimento’, ‘slug’ => ‘entretenimento’, ‘classe_cor’ => ‘border-rosa’ ),
array( ‘titulo’ => ‘Esportes’, ‘slug’ => ‘esportes’, ‘classe_cor’ => ‘border-laranja’ ),
);
foreach ( $editorias as $editoria ) :
$ed_query = new WP_Query( array(
‘category_name’ => $editoria[‘slug’],
‘posts_per_page’ => 3, // 1 destaque com foto + 2 listas menores
‘ignore_sticky_posts’ => true,
) );
?>
have_posts() ) : $ed_query->the_post();
$post_idx++;
// O primeiro post da coluna recebe imagem grande
if ( 1 === $post_idx ) : ?>