Add new functios pages & styles

This commit is contained in:
2025-08-07 12:05:32 +00:00
parent 006e242de0
commit b172620cc4
4 changed files with 268 additions and 18 deletions

View File

@ -14,9 +14,17 @@ $context = Timber::context();
Timber::render( 'templates/page.twig', $context );*/
$context = Timber::context();
$timber_post = Timber::get_post();
$context['post'] = $timber_post;
//Timber::render( array( 'templates/page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
Timber::render( array( 'templates/page-' . $timber_post->post_name . '.twig' ), $context );
// Verificar si es subpágina de contactos
$parent = get_post($timber_post->post_parent);
if ($parent && $parent->post_name === 'contactos') {
// Para subpáginas de contactos, usar page-contactos.twig
Timber::render('templates/page-contactos.twig', $context);
} else {
// Para el resto, usar la lógica original
Timber::render(array('templates/page-' . $timber_post->post_name . '.twig'), $context);
}