Styles footer & titles

This commit is contained in:
2025-10-15 15:34:24 +00:00
parent b038f66178
commit 2f6b47a576
6 changed files with 130 additions and 101 deletions

View File

@ -44,7 +44,7 @@ class StarterSite extends Site {
}
});
/** POST "QUÉ ES LA CNT" */
/** ***************** ACERCA DE - POST "QUÉ ES LA CNT" */
// Previene borrar el post "Qué es la cnt" porque forma parte del menú //
$ids_especiales = [10982, 4791, 10981];
define('POST_ESPECIAL_TYPE', 'acerca');
@ -84,9 +84,30 @@ class StarterSite extends Site {
}
return $post_states;
}, 10, 2);
/** FIN *************POST "QUÉ ES LA CNT" */
// ***************TEMP: Debug archivo vídeos
// add_action('template_redirect', function() {
// global $wp_query;
// error_log('🔍 Template: ' . get_query_var('post_type'));
// error_log('🔍 Is post type archive: ' . (is_post_type_archive() ? 'YES' : 'NO'));
// error_log('🔍 Post type archive: ' . (is_post_type_archive('videos') ? 'VIDEOS' : 'NO'));
// });
// add_action('init', function() {
// add_rewrite_rule(
// '(eu|es)/videos/?$',
// 'index.php?lang=$matches[1]&post_type=videos',
// 'top'
// );
// add_rewrite_rule(
// '(eu|es)/videos/page/([0-9]{1,})/?$',
// 'index.php?lang=$matches[1]&post_type=videos&paged=$matches[2]',
// 'top'
// );
// });
// ******************************************
parent::__construct();
}
@ -370,18 +391,7 @@ class StarterSite extends Site {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
if ($post && ( $post->ID === 84 || $post->ID === 331) ) {
return [
'posts' => Timber::get_posts([
'post_type' => 'videos',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC'
]),
'pagination' => null
];
} elseif ($post && ( $post->ID === 9 || $post->ID === 392) ) {
if ($post && ( $post->ID === 9 || $post->ID === 392) ) {
global $wp_query;
$temp_query = $wp_query;
@ -695,7 +705,7 @@ class StarterSite extends Site {
$context['footer_2'] = get_field('footer_text_2', 'option');
//Otras páginas
$context['videos'] = $this->getVideos();
//$context['videos'] = $this->getVideos();
$context['paginas_acerca'] = $this->getPaginasAcerca();
$context['documentos'] = $this->getDocumentos();
$context['enlaces'] = $this->getEnlaces();
@ -783,6 +793,19 @@ class StarterSite extends Site {
]);
}
public function getVideosSlider() {
return [
'posts' => Timber::get_posts([
'post_type' => 'videos',
'posts_per_page' => -1,
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC'
]),
'pagination' => null
];
}
/**
* Funciones globales
*/
@ -857,5 +880,7 @@ class StarterSite extends Site {
$twig->addFunction(new \Twig\TwigFunction('generar_embed', [$this, 'generar_embed_universal']));
return $twig;
}
}

View File

@ -182,15 +182,15 @@ button[type="reset"] {
background: rgba(0, 0, 0, 0.8);
}
@media (991px <= width < 1400px) {
/* @media (991px <= width < 1400px) {
.page-portada .opinion-article .card-img-overlay {
height: 40%;
height: 45%;
}
}
} */
@media (width < 990px) {
@media (width < 1400px) {
.page-portada .opinion-article .card-img-overlay {
height: 20%;
height: 45%;
}
}
@ -208,6 +208,10 @@ button[type="reset"] {
text-overflow: ellipsis;
}
.page-portada .opinion-article .card-title {
-webkit-line-clamp: 1; /* Número de líneas */
}
.page-portada .recent-posts .card-title a,
.page-portada .opinion-article .card-title a {
color: var(--white);

View File

@ -51,11 +51,12 @@
</div>
<div class="py-2 text-center mt-5 border-top border-light">
{% if function('pll_current_language') == 'eu' %}
{# {% if function('pll_current_language') == 'eu' %}
<p>Web orri honen edukia Creative Commons Aitortu-Partekatu Berdin 4.0 Nazioarteko lizentzia baten pean dago, kanpoko iturri bat adierazten denean izan ezik.</p>
{% else %}
<p>El contenido de esta página web está bajo una licencia Creative Commons Reconocimiento-Compartir Igual 4.0 Internacional excepto aquel en el que se indique una fuente externa.</p>
{% endif %}
{% endif %} #}
<p>{{ __('El contenido de esta página web está bajo una licencia Creative Commons Reconocimiento-Compartir Igual 4.0 Internacional excepto aquel en el que se indique una fuente externa.', 'Sindikatua') }}</p>
<p class="mb-0 fs-8">&bullet; {{ __('Todos los derechos reservados', 'Sindikatua') }}&bullet; {{"now"|date('Y')}}</p>
<a class="nav-link d-inline" href="/politica-de-privacidad">{{ __('Aviso legal y política de privacidad', 'Sindikatua') }} &bullet;</a>
<a class="nav-link d-inline" href="/politica-de-cookies">{{ __('Política de cookies', 'Sindikatua') }}</a>

View File

@ -1,7 +1,7 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<h1 class="mb-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<section class="posts-noticias">
{% if posts_noticias %}

View File

@ -1,15 +1,12 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<h1 class="mb-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ __('Opinión', 'Sindikatua') }}</h1>
<section class="posts-noticias">
{% if posts_opinion %}
{% for noticias in posts_opinion %}
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto_300.jpg') %}
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}

View File

@ -1,95 +1,97 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
<h1 class="my-5 position-relative fs-4 fw-bold sp-module-title">{{ __('Vídeos', 'Sindikatua') }}</h1>
{# {{ dump(videos.pagination) }}#}
<div class="container text-center">
<div class="row">
{% if videos %}
{% for video in videos %}
<div class="col-xl-3 col-lg-4 col-md-6 col-sm-12 mb-2">
<div class="video-item">
{% set url_video = video.meta('url_video') %}
{% set video_data = generar_embed(url_video) %}
{% if video_data %}
<section class="archive-videos my-3">
<div class="container text-center">
<div class="row">
{% if videos %}
{% for video in videos %}
<div class="col-xl-3 col-lg-4 col-md-6 col-sm-12 mb-2">
<div class="video-item">
{% set url_video = video.meta('url_video') %}
{% set video_data = generar_embed(url_video) %}
{% if video_data %}
{# Thumbnail clickeable en lugar del iframe #}
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
data-bs-toggle="modal"
data-bs-target="#videoModal"
data-video-url="{{ video_data.embed_url }}"
data-video-title="{{ video.titulo }}"
data-video-allow="{{ video_data.allow }}"
style="cursor: pointer;
background-image: url('{{ video_data.thumbnail_url }}');
background-size: cover;
background-position: center;">
{# Thumbnail clickeable en lugar del iframe #}
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
data-bs-toggle="modal"
data-bs-target="#videoModal"
data-video-url="{{ video_data.embed_url }}"
data-video-title="{{ video.titulo }}"
data-video-allow="{{ video_data.allow }}"
style="cursor: pointer;
background-image: url('{{ video_data.thumbnail_url }}');
background-size: cover;
background-position: center;">
{# Overlay con botón play #}
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px;">
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
{# Overlay con botón play #}
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px;">
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
</div>
</div>
{# Overlay oscuro al hover #}
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
style="transition: opacity 0.3s ease;">
</div>
{# Título del vídeo #}
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
</div>
</div>
{# Overlay oscuro al hover #}
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
style="transition: opacity 0.3s ease;">
</div>
{# Título del vídeo #}
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
</div>
{% else %}
<div class="alert alert-warning">
<h5>{{ video.titulo }}</h5>
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
</div>
{% endif %}
</div>
{% else %}
<div class="alert alert-warning">
<h5>{{ video.titulo }}</h5>
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
</div>
{% endif %}
</div>
{% endfor %}
{% else %}
<p>No hay vídeos disponibles.</p>
{% endif %}
<!-- PAGINATION -->
{% set pagination = videos.pagination %}
<div class="pagination-custom mt-5">
{% include 'partials/pagination-custom.twig' %}
</div>
{% endfor %}
{% else %}
<p>No hay vídeos disponibles.</p>
{% endif %}
<!-- PAGINATION -->
{% set pagination = videos.pagination %}
<div class="pagination-custom mt-5">
{% include 'partials/pagination-custom.twig' %}
</div>
</div>
{# MODAL PARA REPRODUCIR VÍDEO #}
<div class="modal fade" id="videoModal" tabindex="-1" aria-labelledby="videoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="videoModalLabel"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body p-0">
<div class="ratio ratio-16x9">
<iframe id="modalVideoIframe"
src=""
title=""
frameborder="0"
allow=""
allowfullscreen
loading="lazy">
</iframe>
{# MODAL PARA REPRODUCIR VÍDEO #}
<div class="modal fade" id="videoModal" tabindex="-1" aria-labelledby="videoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="videoModalLabel"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body p-0">
<div class="ratio ratio-16x9">
<iframe id="modalVideoIframe"
src=""
title=""
frameborder="0"
allow=""
allowfullscreen
loading="lazy">
</iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}