- 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>
79 lines
3.0 KiB
PHP
79 lines
3.0 KiB
PHP
<?php
|
|
/**
|
|
* Adopta (/adopta/) y listados de cada especie (/especie/perro/, /especie/gato/).
|
|
* Sin filtros: la única separación es Perros / Gatos.
|
|
*/
|
|
get_header();
|
|
|
|
$current = is_tax( 'especie' ) ? get_queried_object() : null;
|
|
$tiles = ! $current && 'tiles' === ga_opt( 'adopcion', 'archive_mode' );
|
|
$groups = array(
|
|
'perro' => array( ga_opt( 'adopcion', 'dog_label' ), (int) ga_opt( 'adopcion', 'dog_image' ), 'dog' ),
|
|
'gato' => array( ga_opt( 'adopcion', 'cat_label' ), (int) ga_opt( 'adopcion', 'cat_image' ), 'cat' ),
|
|
);
|
|
$title = $current ? $current->name : ga__( 'Adopta', 'Adoptatu' );
|
|
if ( $current ) {
|
|
$title = ga_plural( $current->name );
|
|
}
|
|
?>
|
|
|
|
<header class="ga-page-head">
|
|
<div class="ga-wrap">
|
|
<span class="ga-eyebrow"><?php ga_e( 'Adopta', 'Adoptatu' ); ?></span>
|
|
<h1><?php echo esc_html( $title ); ?></h1>
|
|
<?php if ( ga_opt( 'adopcion', 'intro' ) ) : ?>
|
|
<p><?php ga_opt_e( 'adopcion', 'intro' ); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
</header>
|
|
|
|
<section class="ga-section ga-section--tight">
|
|
<div class="ga-wrap">
|
|
<?php if ( ! $tiles ) : ?>
|
|
<nav class="ga-tabs" aria-label="<?php echo esc_attr( ga__( 'Especies', 'Espezieak' ) ); ?>">
|
|
<?php foreach ( $groups as $slug => [ $label ] ) : ?>
|
|
<?php
|
|
$url = ga_species_url( $slug );
|
|
$active = $current && untrailingslashit( get_term_link( $current ) ) === untrailingslashit( $url );
|
|
?>
|
|
<a class="ga-tab<?php echo $active ? ' is-active' : ''; ?>" href="<?php echo esc_url( $url ); ?>"<?php echo $active ? ' aria-current="page"' : ''; ?>><?php echo esc_html( $label ); ?></a>
|
|
<?php endforeach; ?>
|
|
</nav>
|
|
<?php endif; ?>
|
|
|
|
<?php if ( $tiles ) : ?>
|
|
<div class="ga-species">
|
|
<?php foreach ( $groups as $slug => [ $label, $image, $class ] ) : ?>
|
|
<a class="ga-species__tile ga-species__tile--<?php echo esc_attr( $class ); ?>" href="<?php echo esc_url( ga_species_url( $slug ) ); ?>">
|
|
<?php if ( $image ) : ?>
|
|
<?php echo wp_get_attachment_image( $image, 'large', false, array( 'alt' => '' ) ); ?>
|
|
<?php else : ?>
|
|
<span class="ga-species__paw"><?php echo ga_placeholder_svg(); ?></span>
|
|
<?php endif; ?>
|
|
<span class="ga-species__label"><?php echo esc_html( $label ); ?> <span aria-hidden="true">→</span></span>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php elseif ( have_posts() ) : ?>
|
|
<div class="ga-grid">
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
get_template_part( 'template-parts/animal-card' );
|
|
endwhile;
|
|
?>
|
|
</div>
|
|
<nav class="ga-pagination" aria-label="<?php echo esc_attr( ga__( 'Paginación', 'Orrikatzea' ) ); ?>">
|
|
<?php echo paginate_links( array( 'prev_text' => '←', 'next_text' => '→' ) ); ?>
|
|
</nav>
|
|
<?php else : ?>
|
|
<p class="ga-empty"><?php ga_e( 'Ahora mismo no hay animales en esta sección. ¡Vuelve pronto!', 'Une honetan ez dago animaliarik atal honetan. Itzuli laster!' ); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<?php get_template_part( 'template-parts/adoption-process' ); ?>
|
|
</div>
|
|
</section>
|
|
|
|
<?php
|
|
get_footer();
|