Indicaciones del cliente: adopción solo Perros/Gatos, fichas nuevas y todo configurable
- 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>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/* Explicación del proceso de adopción (Personalizar → Adopción y colabora). */
|
||||
$steps = ga_lines( ga_opt( 'adopcion', 'process' ) );
|
||||
if ( ! $steps ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="ga-process">
|
||||
<h2><?php ga_opt_e( 'adopcion', 'process_title' ); ?></h2>
|
||||
<ol class="ga-process__steps">
|
||||
<?php foreach ( $steps as $step ) : ?>
|
||||
<li><?php echo esc_html( $step ); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php if ( ga_opt( 'adopcion', 'process_note' ) ) : ?>
|
||||
<p class="ga-process__note"><?php ga_opt_e( 'adopcion', 'process_note' ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1,30 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Tarjeta de animal (dentro del loop).
|
||||
* Tarjeta de animal (dentro del loop). Por defecto solo foto y nombre;
|
||||
* «detallada» añade edad y frase corta (Personalizar → Adopción).
|
||||
*/
|
||||
$id = get_the_ID();
|
||||
$meta = array_filter( array(
|
||||
ga_get( $id, 'raza' ) ?: ga_species(),
|
||||
ga_age( $id ),
|
||||
ga_label( $id, 'tamano' ),
|
||||
) );
|
||||
$compatible = ga_label( $id, 'compatible' ) ?: array();
|
||||
$id = get_the_ID();
|
||||
$detailed = 'detallada' === ga_opt( 'adopcion', 'card' );
|
||||
?>
|
||||
<article class="ga-card">
|
||||
<?php ga_status_badge(); ?>
|
||||
<article class="ga-card<?php echo $detailed ? ' ga-card--detailed' : ''; ?>">
|
||||
<?php if ( ga_opt( 'adopcion', 'card_status' ) ) : ?>
|
||||
<?php ga_status_badge(); ?>
|
||||
<?php endif; ?>
|
||||
<div class="ga-card__img"><?php ga_animal_photo(); ?></div>
|
||||
<div class="ga-card__body">
|
||||
<h3 class="ga-card__title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
|
||||
<?php if ( $meta ) : ?>
|
||||
<p class="ga-card__meta"><?php echo esc_html( implode( ' · ', $meta ) ); ?></p>
|
||||
<?php if ( $detailed ) : ?>
|
||||
<?php if ( ga_age( $id ) ) : ?>
|
||||
<p class="ga-card__meta"><?php echo esc_html( ga_age( $id ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php if ( has_excerpt() ) : ?>
|
||||
<p class="ga-card__excerpt"><?php echo esc_html( get_the_excerpt() ); ?></p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ( $compatible ) : ?>
|
||||
<ul class="ga-badges">
|
||||
<?php foreach ( $compatible as $c ) : ?>
|
||||
<li><?php echo esc_html( ga_compat_label( $c ) ); ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<span class="ga-card__more"><?php ga_e( 'Ver ficha', 'Ikusi fitxa' ); ?> <?php echo ga_icon( 'arrow' ); ?></span>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
34
wp-content/themes/gure-ametsa/template-parts/home/about.php
Normal file
34
wp-content/themes/gure-ametsa/template-parts/home/about.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$image = (int) ga_opt( 'about', 'image' );
|
||||
$colabora = ga_page_url( 'colabora' );
|
||||
$helps = array_filter( array(
|
||||
array( ga_opt( 'about', 'help1' ), $colabora . '#voluntariado' ),
|
||||
array( ga_opt( 'about', 'help2' ), $colabora . '#material' ),
|
||||
array( ga_opt( 'about', 'help3' ), get_post_type_archive_link( 'animal' ) ),
|
||||
), fn( $h ) => '' !== trim( (string) $h[0] ) );
|
||||
?>
|
||||
<section class="ga-section" id="bilagun">
|
||||
<div class="ga-wrap ga-split">
|
||||
<figure class="ga-photo">
|
||||
<?php if ( $image ) : ?>
|
||||
<?php echo wp_get_attachment_image( $image, 'large', false, array( 'loading' => 'lazy' ) ); ?>
|
||||
<?php else : ?>
|
||||
<div class="ga-photo__placeholder"><?php echo ga_placeholder_svg(); ?></div>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<div>
|
||||
<?php ga_section_head( 'about' ); ?>
|
||||
<?php if ( ga_opt( 'about', 'button' ) ) : ?>
|
||||
<p><a class="ga-btn ga-btn--primary" href="<?php echo esc_url( ga_page_url( 'quienes-somos' ) ); ?>"><?php ga_opt_e( 'about', 'button' ); ?> <?php echo ga_icon( 'arrow' ); ?></a></p>
|
||||
<?php endif; ?>
|
||||
<?php if ( $helps ) : ?>
|
||||
<h3 class="ga-list-title"><?php ga_opt_e( 'about', 'help_title' ); ?></h3>
|
||||
<ul class="ga-linklist">
|
||||
<?php foreach ( $helps as [ $label, $href ] ) : ?>
|
||||
<li><a href="<?php echo esc_url( $href ); ?>"><?php echo esc_html( $label ); ?> <?php echo ga_icon( 'arrow' ); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -8,9 +8,9 @@ $button = ga_opt( 'animals', 'button' )
|
||||
<?php ga_section_head( 'animals', array( 'extra' => $button ) ); ?>
|
||||
<?php
|
||||
echo do_shortcode( sprintf(
|
||||
'[ga_animales numero="%d" estado="%s" vista="%s"]',
|
||||
'[ga_animales numero="%d" destacados="%s" vista="%s"]',
|
||||
max( 1, (int) ga_opt( 'animals', 'count' ) ),
|
||||
esc_attr( ga_opt( 'animals', 'filter' ) ),
|
||||
'destacados' === ga_opt( 'animals', 'filter' ) ? '1' : '',
|
||||
esc_attr( ga_opt( 'animals', 'view' ) )
|
||||
) );
|
||||
?>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
$image = (int) ga_opt( 'foster', 'image' );
|
||||
$items = ga_lines( ga_opt( 'foster', 'list' ) );
|
||||
$url = add_query_arg( 'motivo', 'acogida', ga_page_url( 'contacto' ) ) . '#formulario';
|
||||
$url = ga_page_url( 'acoge' );
|
||||
?>
|
||||
<section class="ga-section" id="acogida">
|
||||
<section class="ga-section ga-section--sand" id="acogida">
|
||||
<div class="ga-wrap ga-split">
|
||||
<div>
|
||||
<?php ga_section_head( 'foster' ); ?>
|
||||
@@ -25,7 +25,7 @@ $url = add_query_arg( 'motivo', 'acogida', ga_page_url( 'contacto' ) ) . '#for
|
||||
<?php if ( $image ) : ?>
|
||||
<?php echo wp_get_attachment_image( $image, 'large', false, array( 'loading' => 'lazy' ) ); ?>
|
||||
<?php else : ?>
|
||||
<div class="ga-photo__placeholder"><?php echo ga_icon( 'paw' ); ?></div>
|
||||
<div class="ga-photo__placeholder"><?php echo ga_placeholder_svg(); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( ga_opt( 'foster', 'caption' ) ) : ?>
|
||||
<figcaption><?php ga_opt_e( 'foster', 'caption' ); ?></figcaption>
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
$colabora = ga_page_url( 'colabora' );
|
||||
$links = array(
|
||||
1 => get_post_type_archive_link( 'animal' ),
|
||||
2 => $colabora . '#acogida',
|
||||
2 => ga_page_url( 'acoge' ),
|
||||
3 => $colabora . '#voluntariado',
|
||||
4 => $colabora . '#donaciones',
|
||||
4 => $colabora . '#material',
|
||||
);
|
||||
?>
|
||||
<section class="ga-section ga-section--sand">
|
||||
|
||||
@@ -3,16 +3,16 @@ $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' ), get_post_type_archive_link( 'animal' ) );
|
||||
$btn2 = ga_link( ga_opt( 'hero', 'btn2_url' ), ga_page_url( 'contacto', '#formulario' ) );
|
||||
$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 => $colabora . '#acogida',
|
||||
2 => ga_page_url( 'acoge' ),
|
||||
3 => $colabora . '#voluntariado',
|
||||
4 => $colabora . '#donaciones',
|
||||
4 => $colabora . '#material',
|
||||
);
|
||||
|
||||
$classes = array( 'ga-hero', $full ? 'ga-hero--full' : 'ga-hero--split' );
|
||||
@@ -53,7 +53,7 @@ if ( $doors ) {
|
||||
<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' ); ?></a>
|
||||
<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>
|
||||
@@ -63,7 +63,7 @@ if ( $doors ) {
|
||||
<?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_icon( 'paw' ); ?></div>
|
||||
<div class="ga-hero__art"><?php echo ga_placeholder_svg(); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -9,8 +9,8 @@ foreach ( array( 'dog' => 'perro', 'cat' => 'gato' ) as $key => $slug ) {
|
||||
}
|
||||
$tiles[ $key ] = array(
|
||||
'url' => $term && ! is_wp_error( $term ) ? get_term_link( $term ) : get_post_type_archive_link( 'animal' ),
|
||||
'label' => ga_opt( 'species', "{$key}_label" ),
|
||||
'image' => (int) ga_opt( 'species', "{$key}_image" ),
|
||||
'label' => ga_opt( 'adopcion', "{$key}_label" ),
|
||||
'image' => (int) ga_opt( 'adopcion', "{$key}_image" ),
|
||||
);
|
||||
}
|
||||
?>
|
||||
@@ -25,7 +25,7 @@ foreach ( array( 'dog' => 'perro', 'cat' => 'gato' ) as $key => $slug ) {
|
||||
<?php if ( $tile['image'] ) : ?>
|
||||
<?php echo wp_get_attachment_image( $tile['image'], 'large', false, array( 'loading' => 'lazy', 'alt' => '' ) ); ?>
|
||||
<?php else : ?>
|
||||
<span class="ga-species__paw"><?php echo ga_icon( 'paw' ); ?></span>
|
||||
<span class="ga-species__paw"><?php echo ga_placeholder_svg(); ?></span>
|
||||
<?php endif; ?>
|
||||
<span class="ga-species__label"><?php echo esc_html( $tile['label'] ); ?> <span aria-hidden="true">→</span></span>
|
||||
</a>
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
<?php $with_form = (bool) ga_opt( 'talk', 'form' ); ?>
|
||||
<section class="ga-section ga-section--dark" id="contacto">
|
||||
<div class="ga-wrap ga-talk">
|
||||
<div class="ga-wrap <?php echo $with_form ? 'ga-talk' : 'ga-narrow'; ?>">
|
||||
<div>
|
||||
<?php ga_section_head( 'talk' ); ?>
|
||||
<?php if ( ga_info( 'cita' ) ) : ?>
|
||||
<p class="ga-cita ga-cita--dark"><?php echo ga_icon( 'clock' ); ?> <span><?php echo esc_html( ga_info( 'cita' ) ); ?></span></p>
|
||||
<?php endif; ?>
|
||||
<ul class="ga-iconlist ga-iconlist--big">
|
||||
<?php if ( ga_info( 'telefono' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'phone' ); ?><span><strong><?php ga_e( 'Teléfono', 'Telefonoa' ); ?></strong><a href="<?php echo esc_attr( ga_tel_link() ); ?>"><?php echo esc_html( ga_info( 'telefono' ) ); ?></a></span></li>
|
||||
@@ -9,17 +13,20 @@
|
||||
<?php if ( ga_info( 'email' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'mail' ); ?><span><strong>Email</strong><a href="mailto:<?php echo esc_attr( ga_info( 'email' ) ); ?>"><?php echo esc_html( ga_info( 'email' ) ); ?></a></span></li>
|
||||
<?php endif; ?>
|
||||
<?php if ( ga_info( 'direccion' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'pin' ); ?><span><strong><?php ga_e( 'Dirección', 'Helbidea' ); ?></strong><?php echo esc_html( ga_info( 'direccion' ) ); ?></span></li>
|
||||
<?php endif; ?>
|
||||
<?php if ( ga_info( 'horario' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'clock' ); ?><span><strong><?php ga_e( 'Horario', 'Ordutegia' ); ?></strong><?php echo esc_html( ga_info( 'horario' ) ); ?></span></li>
|
||||
<li><?php echo ga_icon( 'clock' ); ?><span><strong><?php ga_e( 'Atención al público', 'Jendaurreko arreta' ); ?></strong><?php echo esc_html( ga_info( 'horario' ) ); ?></span></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<?php $social = ga_social_links( true ); ?>
|
||||
<?php if ( $social ) : ?>
|
||||
<div class="ga-social-inline"><?php echo $social; // Escapado en la función. ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="ga-panel ga-panel--form" id="formulario">
|
||||
<h3><?php ga_opt_e( 'talk', 'form_title' ); ?></h3>
|
||||
<?php echo do_shortcode( '[ga_contacto]' ); ?>
|
||||
</div>
|
||||
<?php if ( $with_form ) : ?>
|
||||
<div class="ga-panel ga-panel--form" id="formulario">
|
||||
<h3><?php ga_opt_e( 'talk', 'form_title' ); ?></h3>
|
||||
<?php echo do_shortcode( '[ga_contacto]' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
$image = (int) ga_opt( 'visit', 'image' );
|
||||
?>
|
||||
<section class="ga-section ga-section--sand" id="visitanos">
|
||||
<div class="ga-wrap">
|
||||
<?php ga_section_head( 'visit' ); ?>
|
||||
<div class="ga-location">
|
||||
<div class="ga-location__photo">
|
||||
<?php if ( $image ) : ?>
|
||||
<?php echo wp_get_attachment_image( $image, 'large', false, array( 'loading' => 'lazy' ) ); ?>
|
||||
<?php else : ?>
|
||||
<div class="ga-photo__placeholder"><?php echo ga_icon( 'paw' ); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="ga-location__info">
|
||||
<h3><?php echo esc_html( ga_opt( 'header', 'brand_line1' ) . ' ' . ga_opt( 'header', 'brand_line2' ) ); ?></h3>
|
||||
<ul class="ga-iconlist">
|
||||
<?php if ( ga_info( 'direccion' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'pin' ); ?><span><?php echo esc_html( ga_info( 'direccion' ) ); ?></span></li>
|
||||
<?php endif; ?>
|
||||
<?php if ( ga_info( 'horario' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'clock' ); ?><span><?php echo esc_html( ga_info( 'horario' ) ); ?></span></li>
|
||||
<?php endif; ?>
|
||||
<?php if ( ga_info( 'telefono' ) ) : ?>
|
||||
<li><?php echo ga_icon( 'phone' ); ?><a href="<?php echo esc_attr( ga_tel_link() ); ?>"><?php echo esc_html( ga_info( 'telefono' ) ); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<div class="ga-location__actions">
|
||||
<?php if ( ga_info( 'maps' ) ) : ?>
|
||||
<a class="ga-btn ga-btn--primary" href="<?php echo esc_url( ga_info( 'maps' ) ); ?>" target="_blank" rel="noopener"><?php ga_e( 'Cómo llegar', 'Nola iritsi' ); ?> <?php echo ga_icon( 'arrow' ); ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if ( ga_opt( 'visit', 'button' ) ) : ?>
|
||||
<a class="ga-btn ga-btn--outline" href="<?php echo esc_url( ga_page_url( 'hotel' ) ); ?>"><?php ga_opt_e( 'visit', 'button' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user