Files
cnt-sindikatua/archive-noticias.php
2025-10-15 11:23:50 +00:00

19 lines
681 B
PHP

<?php
/**
* Category 'noticias'
* Temporal. De momento no pasan por aquí.
*/
global $params;
$context = Timber::context();
// 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
);
$context['posts_noticias'] = Timber::get_posts($query);
error_log('✅ category-noticias.php - Posts: ' . count($context['posts_noticias']));
Timber::render('templates/page-noticias.twig', $context);