MODIFY searcher

This commit is contained in:
2025-08-13 08:58:35 +00:00
parent d800c2cbc2
commit 223bca3767
8 changed files with 101 additions and 53 deletions

View File

@ -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);