<?php
function fiche_experience_shortcode($atts){
$p = get_post();
if(!$p) return '';
// Helpers ACF
$g = function($k){ return function_exists('get_field') ? get_field($k) : ''; };
ob_start(); ?>
<article class="fiche-experience">
<header>
<h1><?php echo esc_html(get_the_title()); ?></h1>
<?php if(has_post_thumbnail()) the_post_thumbnail('large', ['class'=>'fiche-cover']); ?>
<p class="resume"><?php echo esc_html(get_the_excerpt()); ?></p>
<ul class="meta-top">
<li><strong>Modalité :</strong> <?php echo esc_html($g('modalite')); ?></li>
<li><strong>Pays :</strong> <?php echo esc_html($g('pays')); ?></li>
<li><strong>Rôle :</strong> <?php echo esc_html($g('role')); ?></li>
</ul>
</header>
<?php if($g('contexte')): ?>
<section><h2>Contexte & Enjeux</h2><div><?php echo wp_kses_post($g('contexte')); ?></div></section>
<?php endif; ?>
<?php if($g('objectifs')): ?>
<section><h2>Objectifs (SMART)</h2><div><?php echo wp_kses_post($g('objectifs')); ?></div></section>
<?php endif; ?>
<section><h2>Dispositif & Scénarisation</h2>
<p><strong>Parcours :</strong> <?php echo esc_html($g('parcours')); ?></p>
<div><strong>Activités clés :</strong><br><?php echo wp_kses_post($g('activites_cles')); ?></div>
</section>
<section><h2>Outils & Écosystème</h2><div><?php echo wp_kses_post($g('outils')); ?></div></section>
<section><h2>Évaluation & Données</h2>
<p><strong>Évaluations :</strong> <?php echo esc_html($g('evaluations')); ?></p>
<p><strong>KPIs :</strong> <?php echo esc_html($g('kpis')); ?></p>
</section>
<section><h2>Résultats & Impact</h2><div><?php echo wp_kses_post($g('resultats')); ?></div></section>
<?php if($g('verbatims')): ?>
<section><h2>Verbatims</h2><div><?php echo wp_kses_post($g('verbatims')); ?></div></section>
<?php endif; ?>
<section><h2>Retour d’expérience & Améliorations</h2><div><?php echo wp_kses_post($g('rex')); ?></div></section>
<footer class="meta-bottom">
<p><strong>Confidentialité :</strong> <?php echo esc_html($g('confidentialite')); ?></p>
<p><strong>Budget :</strong> <?php echo esc_html($g('budget')); ?></p>
</footer>
</article>
<?php return ob_get_clean();
}
add_shortcode('fiche-experience','fiche_experience_shortcode');
Hello world!
Commentaires
Une réponse à “Hello world!”
-
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.
Laisser un commentaire