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>
This commit is contained in:
100
wp-content/themes/gure-ametsa/single-animal.php
Normal file
100
wp-content/themes/gure-ametsa/single-animal.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
get_header();
|
||||
|
||||
while ( have_posts() ) :
|
||||
the_post();
|
||||
$id = get_the_ID();
|
||||
$estado = ga_get( $id, 'estado' ) ?: 'disponible';
|
||||
$fields = ga_fields();
|
||||
$facts = array_filter( array(
|
||||
ga__( 'Especie', 'Espeziea' ) => ga_species(),
|
||||
$fields['sexo']['label'] => ga_label( $id, 'sexo' ),
|
||||
$fields['edad']['label'] => ga_age( $id ),
|
||||
$fields['tamano']['label'] => ga_label( $id, 'tamano' ),
|
||||
$fields['raza']['label'] => ga_get( $id, 'raza' ),
|
||||
ga__( 'Llegó el', 'Iritsiera' ) => ga_label( $id, 'llegada' ),
|
||||
) );
|
||||
$salud = ga_label( $id, 'salud' ) ?: array();
|
||||
$compatible = ga_label( $id, 'compatible' ) ?: array();
|
||||
$archive = get_post_type_archive_link( 'animal' );
|
||||
?>
|
||||
|
||||
<section class="ga-section" style="padding-top:48px">
|
||||
<div class="ga-wrap">
|
||||
<p><a href="<?php echo esc_url( $archive ); ?>"><?php ga_e( '← Todos los animales', '← Animalia guztiak' ); ?></a></p>
|
||||
<article class="ga-animal">
|
||||
<div class="ga-animal__photo"><?php ga_animal_photo( 'ga-square' ); ?></div>
|
||||
<div>
|
||||
<?php ga_status_badge(); ?>
|
||||
<h1 style="margin-top:14px"><?php the_title(); ?></h1>
|
||||
|
||||
<?php if ( $facts ) : ?>
|
||||
<ul class="ga-animal__facts">
|
||||
<?php foreach ( $facts as $label => $value ) : ?>
|
||||
<li><span><?php echo esc_html( $label ); ?></span><strong><?php echo esc_html( $value ); ?></strong></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $salud ) : ?>
|
||||
<ul class="ga-tags" aria-label="<?php echo esc_attr( $fields['salud']['label'] ); ?>">
|
||||
<?php foreach ( $salud as $s ) : ?><li><?php echo esc_html( $s ); ?></li><?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $compatible ) : ?>
|
||||
<p><strong><?php echo esc_html( $fields['compatible']['label'] ); ?>:</strong> <?php echo esc_html( implode( ', ', $compatible ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="ga-animal__content"><?php the_content(); ?></div>
|
||||
|
||||
<?php if ( 'adoptado' === $estado ) : ?>
|
||||
<div class="ga-box">
|
||||
<h3><?php echo esc_html( ga__( '¡' . get_the_title() . ' ya tiene familia! 🎉', get_the_title() . ': familia du jada! 🎉' ) ); ?></h3>
|
||||
<p>
|
||||
<?php ga_e( 'Pero muchos otros siguen esperando.', 'Baina beste asko zain daude oraindik.' ); ?>
|
||||
<a href="<?php echo esc_url( $archive ); ?>"><?php ga_e( 'Conócelos aquí', 'Ezagutu hemen' ); ?></a>.
|
||||
</p>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="ga-cta-box">
|
||||
<h3><?php echo esc_html( ga__( '¿Quieres conocer a ' . get_the_title() . '?', get_the_title() . ' ezagutu nahi duzu?' ) ); ?></h3>
|
||||
<p>
|
||||
<?php ga_e( 'Escríbenos y te contaremos todo sobre su carácter y cuidados.', 'Idatzi iezaguzu eta bere izaera eta zaintzari buruzko guztia kontatuko dizugu.' ); ?>
|
||||
<?php if ( 'acogida' === $estado ) { ga_e( 'Busca una casa de acogida temporal.', 'Aldi baterako harrera-etxe bat behar du.' ); } ?>
|
||||
</p>
|
||||
<a class="ga-btn" href="<?php echo esc_url( ga_adopt_url() ); ?>">
|
||||
<?php 'acogida' === $estado ? ga_e( 'Quiero acogerle', 'Harrera egin nahi diot' ) : ga_e( 'Quiero adoptarle', 'Adoptatu nahi dut' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
$related = ga_query_animals( array( 'numero' => 4 ) );
|
||||
$related->posts = array_values( array_filter( $related->posts, fn( $p ) => $p->ID !== $id ) );
|
||||
$related->post_count = min( 3, count( $related->posts ) );
|
||||
if ( $related->post_count ) :
|
||||
?>
|
||||
<section class="ga-section ga-section--sand">
|
||||
<div class="ga-wrap">
|
||||
<h2><?php ga_e( 'También buscan hogar', 'Hauek ere etxe bila dabiltza' ); ?></h2>
|
||||
<div class="ga-grid">
|
||||
<?php
|
||||
while ( $related->have_posts() ) :
|
||||
$related->the_post();
|
||||
get_template_part( 'template-parts/animal-card' );
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
endif;
|
||||
endwhile;
|
||||
|
||||
get_footer();
|
||||
Reference in New Issue
Block a user