- Adopción sin filtros ni etiquetas: acceso a Perros y Gatos, tarjetas de foto y nombre. - Ficha nueva: galería, vídeo, fecha de nacimiento o edad aproximada, carácter, necesidades, convivencia y hogar que buscamos (textos por idioma, datos compartidos). - Estados disponible / en proceso / adoptado y animales destacados. - Botón «Quiero conocerlo/la» con formulario breve (animal incluido) y confirmación. - Botones para compartir cada ficha (WhatsApp, Facebook, copiar enlace). - Portada corta según la propuesta del cliente; donaciones, cifras, etc. ocultas. - Páginas Acoge y Preguntas frecuentes, menú con submenús, sin hotel. - Aviso de cita previa y lista de ayuda material editables desde el panel. - Plugin núcleo dividido en módulos (i18n, animales, formularios, APIs). - Migración 5 idempotente: respeta las páginas editadas por el cliente. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
3.8 KiB
PHP
89 lines
3.8 KiB
PHP
<?php
|
|
$image = (int) ga_opt( 'hero', 'image' );
|
|
$video = (int) ga_opt( 'hero', 'video' );
|
|
$full = 'full' === ga_opt( 'hero', 'layout' );
|
|
$overlay = min( 95, (int) ga_opt( 'hero', 'overlay' ) ) / 100;
|
|
$btn1 = ga_link( ga_opt( 'hero', 'btn1_url' ), ga_species_url( 'perro' ) );
|
|
$btn2 = ga_link( ga_opt( 'hero', 'btn2_url' ), ga_species_url( 'gato' ) );
|
|
$doors = ga_opt( 'hero', 'doors' );
|
|
|
|
$colabora = ga_page_url( 'colabora' );
|
|
$door_links = array(
|
|
1 => get_post_type_archive_link( 'animal' ),
|
|
2 => ga_page_url( 'acoge' ),
|
|
3 => $colabora . '#voluntariado',
|
|
4 => $colabora . '#material',
|
|
);
|
|
|
|
$classes = array( 'ga-hero', $full ? 'ga-hero--full' : 'ga-hero--split' );
|
|
if ( $full && ( $image || $video ) ) {
|
|
$classes[] = 'has-media';
|
|
}
|
|
if ( $doors ) {
|
|
$classes[] = 'has-doors';
|
|
}
|
|
?>
|
|
<section class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>" style="--ga-overlay:<?php echo esc_attr( $overlay ); ?>">
|
|
<?php if ( $full && ( $image || $video ) ) : ?>
|
|
<div class="ga-hero__bg" aria-hidden="true">
|
|
<?php if ( $video && wp_get_attachment_url( $video ) ) : ?>
|
|
<video autoplay muted loop playsinline preload="metadata"
|
|
<?php echo $image ? 'poster="' . esc_url( wp_get_attachment_image_url( $image, 'full' ) ) . '"' : ''; ?>>
|
|
<source src="<?php echo esc_url( wp_get_attachment_url( $video ) ); ?>" type="<?php echo esc_attr( get_post_mime_type( $video ) ); ?>">
|
|
</video>
|
|
<?php else : ?>
|
|
<?php echo wp_get_attachment_image( $image, 'full', false, array( 'fetchpriority' => 'high', 'alt' => '' ) ); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php elseif ( $full ) : ?>
|
|
<div class="ga-hero__paw" aria-hidden="true"><?php echo ga_logo_svg( 'mark' ) ?: ga_icon( 'paw' ); ?></div>
|
|
<?php endif; ?>
|
|
|
|
<div class="ga-wrap ga-hero__inner">
|
|
<div class="ga-hero__text">
|
|
<?php if ( ga_opt( 'hero', 'eyebrow' ) ) : ?>
|
|
<span class="ga-pill"><?php ga_opt_e( 'hero', 'eyebrow' ); ?></span>
|
|
<?php endif; ?>
|
|
<h1><?php echo ga_highlight( ga_opt( 'hero', 'title' ) ); // Escapado en la función. ?></h1>
|
|
<?php if ( ga_opt( 'hero', 'lead' ) ) : ?>
|
|
<p class="ga-hero__lead"><?php ga_opt_e( 'hero', 'lead' ); ?></p>
|
|
<?php endif; ?>
|
|
<div class="ga-hero__actions">
|
|
<?php if ( ga_opt( 'hero', 'btn1' ) ) : ?>
|
|
<a class="ga-btn ga-btn--accent" href="<?php echo esc_url( $btn1 ); ?>"><?php ga_opt_e( 'hero', 'btn1' ); ?> <?php echo ga_icon( 'arrow' ); ?></a>
|
|
<?php endif; ?>
|
|
<?php if ( ga_opt( 'hero', 'btn2' ) ) : ?>
|
|
<a class="ga-btn ga-btn--ghost" href="<?php echo esc_url( $btn2 ); ?>"><?php ga_opt_e( 'hero', 'btn2' ); ?> <?php echo ga_icon( 'arrow' ); ?></a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if ( ! $full ) : ?>
|
|
<div class="ga-hero__media">
|
|
<?php if ( $image ) : ?>
|
|
<?php echo wp_get_attachment_image( $image, 'large', false, array( 'fetchpriority' => 'high' ) ); ?>
|
|
<?php else : ?>
|
|
<div class="ga-hero__art"><?php echo ga_placeholder_svg(); ?></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<?php if ( $doors ) : ?>
|
|
<nav class="ga-doors" aria-label="<?php echo esc_attr( ga__( 'Formas de ayudar', 'Laguntzeko moduak' ) ); ?>">
|
|
<div class="ga-wrap ga-doors__grid">
|
|
<?php foreach ( $door_links as $n => $href ) : ?>
|
|
<?php if ( ga_opt( 'hero', "door{$n}_title" ) ) : ?>
|
|
<a class="ga-door ga-door--<?php echo (int) $n; ?>" href="<?php echo esc_url( $href ); ?>">
|
|
<span class="ga-door__kicker"><?php ga_opt_e( 'hero', "door{$n}_kicker" ); ?></span>
|
|
<span class="ga-door__title"><?php ga_opt_e( 'hero', "door{$n}_title" ); ?></span>
|
|
<span class="ga-door__text"><?php ga_opt_e( 'hero', "door{$n}_text" ); ?></span>
|
|
<span class="ga-door__link"><?php ga_opt_e( 'hero', "door{$n}_link" ); ?> <?php echo ga_icon( 'arrow' ); ?></span>
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</nav>
|
|
<?php endif; ?>
|