Add new functios pages & styles
This commit is contained in:
12
page.php
12
page.php
@ -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);
|
||||
}
|
Reference in New Issue
Block a user