Files
cnt-sindikatua/page.php

38 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2025-07-14 07:33:32 +00:00
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*/
$context = Timber::context();
2025-07-16 07:33:09 +00:00
$timber_post = Timber::get_post();
$context['post'] = $timber_post;
2025-08-13 08:58:35 +00:00
$context['search_query'] = get_search_query();
2025-08-07 12:05:32 +00:00
2025-10-27 11:27:41 +00:00
//Timber::render( array( 'templates/page-' . $timber_post->slug . '.twig', 'page.twig' ), $context );
$parent = $timber_post->parent;
2025-07-24 09:31:42 +00:00
2025-10-27 11:27:41 +00:00
$slug_actual = $timber_post->slug;
2025-10-08 08:06:54 +00:00
$pagina_servicios = ($slug_actual === 'servicios-privados' || $slug_actual === 'servicios-publicos' || $slug_actual === 'zerbitzu-pribatuak' || $slug_actual === 'zerbitzu-publikoak');
2025-10-03 08:09:11 +00:00
2025-10-27 11:27:41 +00:00
if ($parent && ($parent->slug === 'contactos' || $parent->slug === 'kontaktua') ) {
2025-10-03 08:09:11 +00:00
// subpáginas de contactos
2025-08-07 12:05:32 +00:00
Timber::render('templates/page-contactos.twig', $context);
2025-10-08 08:06:54 +00:00
} elseif ($pagina_servicios) {
2025-10-14 15:08:21 +00:00
error_log('✅ (page.php) Página Servicios: ' . $slug_actual);
2025-10-03 08:09:11 +00:00
Timber::render('templates/page-servicios.twig', $context);
2025-10-14 15:08:21 +00:00
} elseif ( $slug_actual === 'noticias' || $slug_actual === 'berriak') {
2025-10-15 11:23:50 +00:00
error_log('🔴 (page.php) Página noticias - ERROR');
2025-10-27 11:27:41 +00:00
} elseif ($parent && ($parent->slug == 'acerca-de-la-cnt' || $parent->slug == 'cnt-ri-buruz') ) {
$context['es_subpagina'] = true;
$context['subpagina'] = $timber_post;
$context['post'] = $timber_post->parent;
Timber::render(array('templates/page-acerca-de-la-cnt.twig'), $context);
2025-08-07 12:05:32 +00:00
} else {
2025-10-28 09:17:55 +00:00
error_log('✅ (page.php) Página General: ' . $timber_post->slug);
2025-10-27 11:27:41 +00:00
Timber::render(array('templates/page-' . $timber_post->slug . '.twig', 'templates/page.twig'), $context);
2025-08-07 12:05:32 +00:00
}