add pag default cnt
This commit is contained in:
@ -61,6 +61,12 @@ class StarterSite extends Site {
|
||||
}
|
||||
return $tag;
|
||||
}, 10, 1);
|
||||
|
||||
// Imagen por defecto
|
||||
add_filter('timber/context', function ($context) {
|
||||
$context['imagen_default'] = '/wp-content/uploads/2025/10/Imagen_por_defecto_CNT.jpg';
|
||||
return $context;
|
||||
});
|
||||
|
||||
// *** SOLO USAR UNA VEZ PARA LIMPIAR. NO FUNCIONABA LA PAGINACIÓN DE SEARCH.
|
||||
// add_action('init', function() {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
{% if posts_conflictos %}
|
||||
{% for noticias in posts_conflictos %}
|
||||
|
||||
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto_300.jpg') %}
|
||||
{% set imagen = noticias.thumbnail.src | default(imagen_default) %}
|
||||
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
|
||||
|
||||
<div class="card my-3 position-relative posts-noticias">
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
{% if posts_industry |length > 0 %}
|
||||
{% for noticias in posts_industry %}
|
||||
|
||||
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto.png') %}
|
||||
{% set imagen = noticias.thumbnail.src | default(imagen_default) %}
|
||||
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
|
||||
|
||||
<div class="card my-3 position-relative posts-noticias">
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
{% 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 imagen = noticias.thumbnail.src | default(imagen_default) %}
|
||||
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
|
||||
|
||||
<div class="card my-3 position-relative posts-noticias">
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
{% 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 imagen = noticias.thumbnail.src | default(imagen_default) %}
|
||||
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
|
||||
|
||||
<div class="card my-3 position-relative posts-noticias">
|
||||
|
||||
@ -3,18 +3,23 @@
|
||||
{% block content %}
|
||||
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
|
||||
|
||||
|
||||
{# {% for pagina in post.children('page') %}
|
||||
{{ pagina.title }}
|
||||
{% endfor %} #}
|
||||
|
||||
<section class="section-servicios">
|
||||
{% if subpaginas_servicios |length > 0 %}
|
||||
{% for noticias in subpaginas_servicios %}
|
||||
|
||||
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto.png') %}
|
||||
{% set imagen = noticias.thumbnail.src | default(imagen_default) %}
|
||||
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
|
||||
|
||||
<div class="card my-3 position-relative posts-noticias">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-4">
|
||||
<img src="{{ imagen }}" alt="{{ alt }}"
|
||||
class="rounded-start img-noticias"
|
||||
class="p-2 img-noticias"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
|
||||
Reference in New Issue
Block a user