From b038f6617806dfd8d3096d4eec763f92bc133f51 Mon Sep 17 00:00:00 2001 From: gustavo Date: Wed, 15 Oct 2025 15:33:50 +0000 Subject: [PATCH] refactor videos --- NewArchive.md | 9 +++++++++ archive-videos.php | 12 ++++++++++++ archive.php | 2 +- functions.php | 2 +- page.php | 7 +------ template-portada.php | 1 + 6 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 NewArchive.md create mode 100644 archive-videos.php diff --git a/NewArchive.md b/NewArchive.md new file mode 100644 index 0000000..6433ade --- /dev/null +++ b/NewArchive.md @@ -0,0 +1,9 @@ + +En Traducciones > ajustes > post type: marcar el post type. +========================== +En ACF marcar archive y jerárquico. +En URLs añadir el nombre del slug (Ej: videos) +========================== +Crear archive-slug.php (Ej: archive-videos.php) +========================== + diff --git a/archive-videos.php b/archive-videos.php new file mode 100644 index 0000000..c227b22 --- /dev/null +++ b/archive-videos.php @@ -0,0 +1,12 @@ +post_name === 'contactos' || $parent->post_name === 'ko //error_log('✅ (page.php) Página "Industria": ' . $parent->post_name); Timber::render('templates/single-industria.twig', $context); } elseif ( $slug_actual === 'noticias' || $slug_actual === 'berriak') { - // $context['posts_noticias'] = Timber::get_posts(array( - // 'post_type' => 'post', - // 'cat' => get_cat_ID('noticias'), // Obtiene los posts de la categoría "noticias" - // )); error_log('🔴 (page.php) Página noticias - ERROR'); - // Timber::render('templates/page-noticias.twig', $context); } else { - error_log('✅ (page.php) Página: ' . $parent->post_name); + error_log('✅ (page.php) Página General: ' . $parent->post_name); Timber::render(array('templates/page-' . $timber_post->post_name . '.twig'), $context); } \ No newline at end of file diff --git a/template-portada.php b/template-portada.php index cbc0579..9cd327f 100644 --- a/template-portada.php +++ b/template-portada.php @@ -12,6 +12,7 @@ $context = Timber::context( 'posts_conflicts' => $site->getLastPostConflicts(), 'lasts_posts_news' => $site->getLastsPostsNews(), 'botones_imagen' => $site->getBotonesEnlaces(), + 'videos' => $site->getVideosSlider(), ] );