Files
gureametsabilagun/wp-content/themes/gure-ametsa/template-parts/home/species.php
Josep Piguillem 0b2c9f271f Web de Gure Ametsa Bi Lagun en WordPress para Dokploy
- Docker Compose (WordPress + MariaDB) listo para Dokploy, con instalación
  automática por etapas: idiomas, páginas, menús y plugins recomendados.
- Web bilingüe castellano / euskera con Polylang.
- Tema propio «gure-ametsa»: diseño inspirado en Beargrass Animal Rescue,
  personalizable desde Apariencia → Personalizar (paletas, tipografías,
  secciones de portada ordenables) y patrones de bloques propios.
- Plugin mu «gure-ametsa-core»: animales en adopción con ficha y filtros,
  carrusel y formulario de contacto/adopción.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 16:21:26 +02:00

36 lines
1.5 KiB
PHP

<?php
/* Accesos grandes a perros y gatos (inspirado en «Meet our dogs / Meet our cats»). */
$tiles = array();
foreach ( array( 'dog' => 'perro', 'cat' => 'gato' ) as $key => $slug ) {
$term = get_term_by( 'slug', $slug, 'especie' );
if ( $term && function_exists( 'pll_get_term' ) ) {
$translated = pll_get_term( $term->term_id, ga_lang() );
$term = $translated ? get_term( $translated, 'especie' ) : $term;
}
$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" ),
);
}
?>
<section class="ga-section ga-species-section">
<div class="ga-wrap">
<?php if ( ga_opt( 'species', 'title' ) ) : ?>
<h2 class="ga-center"><?php ga_opt_e( 'species', 'title' ); ?></h2>
<?php endif; ?>
<div class="ga-species">
<?php foreach ( $tiles as $key => $tile ) : ?>
<a class="ga-species__tile ga-species__tile--<?php echo esc_attr( $key ); ?>" href="<?php echo esc_url( $tile['url'] ); ?>">
<?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>
<?php endif; ?>
<span class="ga-species__label"><?php echo esc_html( $tile['label'] ); ?> <span aria-hidden="true">→</span></span>
</a>
<?php endforeach; ?>
</div>
</div>
</section>