Plugins bloques

This commit is contained in:
Jose Ibáñez
2026-02-13 13:13:06 +01:00
commit 26d7f11378
24 changed files with 6324 additions and 0 deletions
@@ -0,0 +1,72 @@
<?php
/**
* Template: Item por defecto para listados
*
* Variables disponibles:
* - $id, $title, $excerpt, $content, $permalink, $thumbnail
* - $iniciativas, $lineas, $widget, $type
*
* @package Bloques_Transicion
*/
if (!defined('ABSPATH')) {
exit;
}
$classes = ['bloques-item', 'bloques-item-' . $type];
if ($widget === 'list') {
$classes[] = 'bloques-item-list';
}
?>
<article id="bloques-item-<?php echo esc_attr($id); ?>" class="<?php echo esc_attr(implode(' ', $classes)); ?>">
<?php if ($thumbnail): ?>
<div class="bloques-item-thumbnail">
<a href="<?php echo esc_url($permalink); ?>">
<img src="<?php echo esc_url($thumbnail); ?>" alt="<?php echo esc_attr($thumbnail_alt ?: $title); ?>" loading="lazy">
</a>
</div>
<?php endif; ?>
<div class="bloques-item-content">
<header class="bloques-item-header">
<?php if (!empty($iniciativas) || !empty($lineas)): ?>
<div class="bloques-item-taxonomies">
<?php foreach ($iniciativas as $term):
$color = get_field('color', $term);
?>
<span class="bloques-tag bloques-tag-iniciativa" style="<?php echo $color ? '--tag-color: ' . esc_attr($color) . ';' : ''; ?>">
<?php echo esc_html($term->name); ?>
</span>
<?php endforeach; ?>
<?php foreach ($lineas as $term):
$color = get_field('color', $term);
?>
<span class="bloques-tag bloques-tag-linea" style="<?php echo $color ? '--tag-color: ' . esc_attr($color) . ';' : ''; ?>">
<?php echo esc_html($term->name); ?>
</span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<h3 class="bloques-item-title">
<a href="<?php echo esc_url($permalink); ?>">
<?php echo esc_html($title); ?>
</a>
</h3>
</header>
<?php if ($excerpt): ?>
<div class="bloques-item-excerpt">
<?php echo wp_kses_post($excerpt); ?>
</div>
<?php endif; ?>
<footer class="bloques-item-footer">
<a href="<?php echo esc_url($permalink); ?>" class="bloques-item-link">
<?php _e('Ver más', 'bloques-transicion'); ?>
<span class="bloques-arrow">→</span>
</a>
</footer>
</div>
</article>