Style img posts & refactor

This commit is contained in:
2025-10-17 11:25:33 +00:00
parent 78ff00ff53
commit a198ea6eb3
6 changed files with 39 additions and 92 deletions

View File

@ -273,7 +273,7 @@ class StarterSite extends Site {
$polylang_data['current_language_name'] = pll_current_language('name');
$polylang_data['default_language'] = pll_default_language();
// DEBUG: Escribir en el log de errores
// DEBUG
//error_log('Languages: ' . print_r($polylang_data['languages'], true));
//error_log('Current language: ' . $polylang_data['current_language']);
//error_log('Default language: ' . $polylang_data['default_language']);
@ -299,42 +299,6 @@ class StarterSite extends Site {
return $polylang_data;
}
/* TEMP. DELETE... */
private function getAllPostsNews() {
// $post = Timber::get_post();
// //if ($post) { error_log('✅ Este es el ID Página news: ' . $post->ID);}
// $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// //8=noticias CAST & 339= noticias EUSKARA
// if ( $post && ( $post->ID === 8 || $post->ID === 339) ) {
// global $wp_query;
// $temp_query = $wp_query;
// $wp_query = new \WP_Query([
// 'post_type' => 'post',
// 'category_name' => 'noticias',
// 'posts_per_page' => 10,
// 'post_status' => 'publish',
// 'orderby' => 'date',
// 'order' => 'DESC',
// 'paged' => $paged,
// ]);
// $posts = Timber::get_posts(); // Lee de la query global que acabamos de crear
// $pagination = new \Timber\Pagination();
// $wp_query = $temp_query; // Restaurar query original
// return $posts;
// }
// //error_log('❌ getPostsNews - No coincide con ninguna página');
// return [
// 'posts' => [],
// 'pagination' => null
// ];
}
private function getIconsRRSS() {
$icons_rrss = [];

View File

@ -274,21 +274,29 @@ button[type="reset"] {
width: 100%;
}
/* noticias */
.page-portada .img-noticias,
.posts-noticias .img-noticias {
transition: filter 0.3s ease;
}
.page-portada .img-noticias:hover,
.posts-noticias .img-noticias:hover {
filter: grayscale(100%);
.section-opinion .posts-noticias .img-noticias,
.section-noticias .posts-noticias .img-noticias,
.section-industria .posts-noticias .img-noticias,
.section-servicios .posts-noticias .img-noticias {
min-height: 300px;
max-height: 300px;
}
.posts-noticias .card-title-text:hover {
font-weight: bolder;
}
/* efecto img */
.page-portada .img-noticias,
.posts-noticias .img-noticias {
transition: filter 0.3s ease;
}
/* efecto img */
.page-portada .img-noticias:hover,
.posts-noticias .img-noticias:hover {
filter: grayscale(100%);
}
/* FOOTER */
/* Convert SVG RRSS white */
@ -319,17 +327,6 @@ button[type="reset"] {
background-color: var(--rojo-cnt);
}
.servicios-publicos .card img,
.servicios-privados .card img {
width: 100%;
max-width: 50%;
height: auto;
}
.servicios .card .card-body .card-title {
width: fit-content;
}
.enlaces button:not(.collapsed) {
background-color: var(--rojo-cnt);
color: #fff;

View File

@ -128,7 +128,7 @@
<a class="h-100" href="{{ article.link }}">
<img src="{{ imagen }}"
alt="{{ alt }}"
class="card-img h-100 object-fit-cover"
class="card-img h-100 object-fit-cover img-noticias"
style="aspect-ratio: 16/9;"/>
<div class="card-img-overlay d-flex flex-column justify-content-end align-items-start">

View File

@ -1,46 +1,33 @@
{% 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-3 fw-bold sp-module-title">{{ post.title }}</h1>
<!-- INDUSTRIA -->
<section class="posts-noticias">
<section class="section-industria">
{% if posts_industry %}
{% for noticias in posts_industry %}
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto.png') %}
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
<div class="card my-3 position-relative">
<div class="card my-3 position-relative posts-noticias">
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">
<img src="{{ imagen }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ alt }}"
style="min-height: 200px;"
/>
</a>
{# <a href="{{ noticias.link }}" title="{{ noticias.title }}"></a> #}
<img src="{{ imagen }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ alt }}"
style="min-height: 200px;"
/>
</div>
<div class="col-md-8">
<div class="card-body" style="padding-bottom: 60px;">
<a href="{{ noticias.link }}" title="{{ noticias.title }}" class="text-decoration-none card-title">
<h5 class="card-title-text">{{ noticias.title }}</h5>
</a>
<p class="card-text"> {{
noticias.excerpt({
words: 50,
read_more: ''
})
}}</p>
<p class="card-text"><small class="text-body-secondary">{{ noticias.date }}</small></p>
<a href="{{ noticias.link }}"
class="btn position-absolute btn-secondary-cnt"
style="position: absolute; bottom: 15px; right: 15px; z-index: 10;"
>
{{ __('Sigue leyendo', 'Sindikatua') }}...
</a>
{# <a href="{{ noticias.link }}" title="{{ noticias.title }}" class="text-decoration-none card-title"></a> #}
<h5 class="card-title-text">{{ noticias.title }}</h5>
<p class="card-text"> {{noticias.content}}</p>
{# <a href="{{ noticias.link }}" class="btn position-absolute btn-secondary-cnt" style="position: absolute; bottom: 15px; right: 15px; z-index: 10;">
{{ __('Sigue leyendo', 'Sindikatua') }}...</a> #}
</div>
</div>
</div>
@ -48,7 +35,7 @@
{% endfor %}
{% else %}
<h2>no hay artículos</h2>
<p>{{ __('No hay artículos', 'Sindikatua') }}</p>
{% endif %}
<!-- PAGINATION -->

View File

@ -3,21 +3,20 @@
{% block content %}
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<section class="posts-noticias">
<section class="section-noticias">
{% if posts_noticias %}
{% for noticias in posts_noticias %}
{% 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') %}
<div class="card my-3 position-relative">
<div class="card my-3 position-relative posts-noticias">
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">
<img src="{{ imagen }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ alt }}"
style="min-height: 200px;"
/>
</a>
</div>

View File

@ -3,14 +3,14 @@
{% block content %}
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ __('Opinión', 'Sindikatua') }}</h1>
<section class="posts-noticias">
<section class="section-opinion">
{% 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') %}
<div class="card my-3 position-relative">
<div class="card my-3 position-relative posts-noticias">
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">