cgt-wp-theme/footer.php
2026-11-12 21:27:56 +01:00

113 lines
3.8 KiB
PHP

<?php
/**
* Pied de page souverain (3 colonnes) — Union Locale CGT Foix Haute-Ariège.
* Aucune mention "Propulsé par WordPress".
*
* @package CGT_FHA
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$opts = cgt_fha_get_options();
$phone_raw = (string) $opts['phone'];
$phone_href = preg_replace( '/[^0-9+]/', '', $phone_raw );
$email = (string) $opts['email'];
$logo_url = cgt_fha_get_footer_logo_url();
?>
</main>
<footer class="cgt-footer" role="contentinfo">
<div class="cgt-container">
<div class="cgt-footer__grid">
<!-- Colonne 1 : Identité & appel militant -->
<div>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="<?php esc_attr_e( 'Retour à l\'accueil', 'cgt-fha' ); ?>">
<img
src="<?php echo esc_url( $logo_url ); ?>"
alt="Union Locale CGT Foix Haute-Ariège"
class="cgt-footer__logo"
loading="lazy"
decoding="async"
/>
</a>
<?php if ( ! empty( $opts['footer_desc'] ) ) : ?>
<p class="cgt-footer__text"><?php echo esc_html( (string) $opts['footer_desc'] ); ?></p>
<?php endif; ?>
<?php if ( ! empty( $opts['footer_call'] ) ) : ?>
<p class="cgt-footer__call"><?php echo esc_html( (string) $opts['footer_call'] ); ?></p>
<?php endif; ?>
</div>
<!-- Colonne 2 : Nos Locaux & Permanences (visible sur 100 % des pages) -->
<div>
<h2 class="cgt-footer__title"><?php esc_html_e( 'Nos Locaux & Permanences', 'cgt-fha' ); ?></h2>
<ul class="cgt-footer__list">
<?php if ( ! empty( $opts['address'] ) ) : ?>
<li>
<?php echo cgt_fha_render_icon( 'map-pin', 17 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<span><?php echo esc_html( (string) $opts['address'] ); ?></span>
</li>
<?php endif; ?>
<?php if ( '' !== $phone_raw ) : ?>
<li>
<?php echo cgt_fha_render_icon( 'phone', 17 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<a href="<?php echo esc_url( 'tel:' . $phone_href ); ?>"><?php echo esc_html( $phone_raw ); ?></a>
</li>
<?php endif; ?>
<?php if ( '' !== $email ) : ?>
<li>
<?php echo cgt_fha_render_icon( 'mail', 17 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<a href="<?php echo esc_url( 'mailto:' . $email ); ?>"><?php echo esc_html( $email ); ?></a>
</li>
<?php endif; ?>
<?php if ( ! empty( $opts['hours'] ) ) : ?>
<li>
<?php echo cgt_fha_render_icon( 'clock', 17 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<span><?php echo esc_html( (string) $opts['hours'] ); ?></span>
</li>
<?php endif; ?>
<?php if ( ! empty( $opts['facebook_url'] ) ) : ?>
<li>
<?php echo cgt_fha_render_icon( 'facebook', 17 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<a href="<?php echo esc_url( (string) $opts['facebook_url'] ); ?>" target="_blank" rel="noopener noreferrer">
<?php esc_html_e( 'Page Facebook officielle de l\'UL', 'cgt-fha' ); ?>
</a>
</li>
<?php endif; ?>
</ul>
</div>
<!-- Colonne 3 : Accès rapides & Mentions -->
<div>
<h2 class="cgt-footer__title"><?php esc_html_e( 'Accès rapides & Mentions', 'cgt-fha' ); ?></h2>
<?php
wp_nav_menu(
array(
'theme_location' => 'footer',
'container' => false,
'menu_class' => 'cgt-footer__list',
'depth' => 1,
'fallback_cb' => 'cgt_fha_default_footer_menu',
)
);
?>
</div>
</div>
<div class="cgt-footer__bottom">
<span>&copy; <?php echo esc_html( wp_date( 'Y' ) ); ?> Union Locale CGT Foix Haute-Ariège — Tous droits réservés.</span>
<span><?php esc_html_e( 'Union des syndicats CGT — Foix & Haute-Ariège (09)', 'cgt-fha' ); ?></span>
</div>
</div>
</footer>
<?php wp_footer(); ?>
</body>
</html>