66 lines
2.0 KiB
PHP
66 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* Gabarit de secours général (recherche et boucle générique WordPress).
|
|
*
|
|
* @package CGT_FHA
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
get_header();
|
|
|
|
$heading = is_search()
|
|
? sprintf( 'Résultats de recherche pour « %s »', get_search_query() )
|
|
: ( get_bloginfo( 'name' ) ?: 'Union Locale CGT Foix Haute-Ariège' );
|
|
?>
|
|
|
|
<section class="cgt-page-hero">
|
|
<div class="cgt-container">
|
|
<nav class="cgt-breadcrumb" aria-label="<?php esc_attr_e( 'Fil d\'Ariane', 'cgt-fha' ); ?>">
|
|
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php esc_html_e( 'Accueil', 'cgt-fha' ); ?></a>
|
|
<span aria-hidden="true">/</span>
|
|
<span><?php echo esc_html( $heading ); ?></span>
|
|
</nav>
|
|
<h1 class="cgt-page-hero__title"><?php echo esc_html( $heading ); ?></h1>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="cgt-section cgt-section--white">
|
|
<div class="cgt-container">
|
|
<?php if ( have_posts() ) : ?>
|
|
<div class="cgt-news-grid">
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
cgt_fha_render_local_post_card();
|
|
endwhile;
|
|
?>
|
|
</div>
|
|
|
|
<div class="cgt-pagination">
|
|
<?php
|
|
the_posts_pagination(
|
|
array(
|
|
'mid_size' => 2,
|
|
'prev_text' => '← Précédent',
|
|
'next_text' => 'Suivant →',
|
|
)
|
|
);
|
|
?>
|
|
</div>
|
|
<?php else : ?>
|
|
<p><?php esc_html_e( 'Aucun résultat ne correspond à votre recherche.', 'cgt-fha' ); ?></p>
|
|
<form role="search" method="get" class="cgt-search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>" style="margin-left:0;">
|
|
<label for="cgt-index-search" class="screen-reader-text"><?php esc_html_e( 'Rechercher sur le site', 'cgt-fha' ); ?></label>
|
|
<input type="search" id="cgt-index-search" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" placeholder="<?php esc_attr_e( 'Nouvelle recherche…', 'cgt-fha' ); ?>" />
|
|
<button type="submit" class="cgt-btn cgt-btn--primary"><?php esc_html_e( 'Rechercher', 'cgt-fha' ); ?></button>
|
|
</form>
|
|
<?php endif; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<?php
|
|
get_footer();
|