Files
cnt-sindikatua/archive-noticias.php

21 lines
642 B
PHP
Raw Normal View History

2025-10-15 11:23:50 +00:00
<?php
/**
2025-10-20 09:09:04 +00:00
* Archive 'noticias'
2025-10-15 11:23:50 +00:00
*/
global $params;
$context = Timber::context();
2025-10-16 11:26:27 +00:00
2025-10-15 11:23:50 +00:00
// var_dump(get_cat_ID('Noticias'));
$category = get_category_by_slug('noticias');
$query = array(
'post_type' => 'post',
'cat' => $category ? $category->term_id : 201,
'paged' => isset($params['paged']) ? $params['paged'] : 1,
'posts_per_page' => get_option('posts_per_page') // Usa la configuración de WordPress
);
2025-10-22 10:03:03 +00:00
2025-10-15 11:23:50 +00:00
$context['posts_noticias'] = Timber::get_posts($query);
2025-10-20 09:09:04 +00:00
error_log('✅ archive-noticias.php - Posts: ' . count($context['posts_noticias']));
2025-10-15 11:23:50 +00:00
Timber::render('templates/page-noticias.twig', $context);