diff --git a/page.php b/page.php index 8383cf0..2f2f608 100644 --- a/page.php +++ b/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); diff --git a/search.php b/search.php index 9e1ac5f..efa1060 100644 --- a/search.php +++ b/search.php @@ -9,10 +9,6 @@ use Timber\Timber; $templates = [ 'templates/search.twig', 'templates/archive.twig', 'templates/index.twig' ]; -$context = Timber::context( - [ - 'title' => 'Search results for ' . get_search_query(), - ] -); +$context = Timber::context([]); Timber::render( $templates, $context ); diff --git a/views/partials/btn-search.twig b/views/partials/btn-search.twig index fd6e43d..49a1946 100644 --- a/views/partials/btn-search.twig +++ b/views/partials/btn-search.twig @@ -1,16 +1,18 @@ - + \ No newline at end of file diff --git a/views/partials/pagination.twig b/views/partials/pagination.twig index e4d737b..808f7d7 100644 --- a/views/partials/pagination.twig +++ b/views/partials/pagination.twig @@ -1,43 +1,60 @@ {% if posts.pagination.pages is not empty %} -