MODIFY searcher
This commit is contained in:
4
page.php
4
page.php
@ -16,6 +16,7 @@ Timber::render( 'templates/page.twig', $context );*/
|
||||
$context = Timber::context();
|
||||
$timber_post = Timber::get_post();
|
||||
$context['post'] = $timber_post;
|
||||
$context['search_query'] = get_search_query();
|
||||
|
||||
//Timber::render( array( 'templates/page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
|
||||
|
||||
@ -24,6 +25,9 @@ $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);
|
||||
} elseif ($parent && $parent->post_name === 'servicios-privados' || $parent && $parent->post_name === 'servicios-publicos') {
|
||||
// Para subpáginas de servicios privados, usar page-servicio-individual.twig
|
||||
Timber::render('templates/single-servicios.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