Base du thème : gabarits, jetons et effets
This commit is contained in:
commit
e06ad42369
6 changed files with 327 additions and 0 deletions
78
single-realisation.php
Normal file
78
single-realisation.php
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
/* Étude de cas d'une réalisation */
|
||||
get_header();
|
||||
the_post();
|
||||
$id = get_the_ID();
|
||||
$num = yb2026_num($id);
|
||||
$tag = get_post_meta($id, '_yb_tag', true);
|
||||
if (!$tag) $tag = strtoupper((string) get_post_meta($id, '_real_technologies', true));
|
||||
$year = get_post_meta($id, '_yb_year', true);
|
||||
$role = get_post_meta($id, '_yb_role', true);
|
||||
$desc = get_post_meta($id, '_yb_desc', true);
|
||||
$note = get_post_meta($id, '_yb_note', true);
|
||||
$live = get_post_meta($id, '_real_url', true);
|
||||
$sections = json_decode((string) get_post_meta($id, '_yb_sections', true), true);
|
||||
|
||||
/* Projet suivant (par ordre, boucle sur le premier) */
|
||||
$all = yb2026_get_projects();
|
||||
$next = null;
|
||||
foreach ($all as $i => $p) {
|
||||
if ($p->ID === $id) { $next = $all[($i + 1) % count($all)]; break; }
|
||||
}
|
||||
?>
|
||||
|
||||
<article class="case">
|
||||
<div class="case-hero">
|
||||
<?php the_post_thumbnail('full', array('class' => 'case-hero-img')); ?>
|
||||
<div class="case-hero-fade"></div>
|
||||
<div class="case-hero-text">
|
||||
<div class="kicker rise rise-1"><?php echo esc_html($num); ?> · ÉTUDE DE CAS<?php echo $year ? ' · ' . esc_html($year) : ''; ?></div>
|
||||
<h1 class="case-title rise rise-2"><?php echo esc_html(yb2026_short_title(get_post())); ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="case-cols">
|
||||
<aside class="case-meta article__meta">
|
||||
<?php if ($year) : ?><div><div class="case-meta-k">ANNÉE</div><div><?php echo esc_html($year); ?></div></div><?php endif; ?>
|
||||
<?php if ($role) : ?><div><div class="case-meta-k">RÔLE</div><div><?php echo esc_html($role); ?></div></div><?php endif; ?>
|
||||
<?php if ($tag) : ?><div><div class="case-meta-k">STACK</div><div class="lime"><?php echo esc_html($tag); ?></div></div><?php endif; ?>
|
||||
<?php if ($live) : ?><a class="pill-btn" href="<?php echo esc_url($live); ?>" target="_blank" rel="noopener">PROJET EN LIGNE ↗</a><?php endif; ?>
|
||||
</aside>
|
||||
|
||||
<div class="case-body">
|
||||
<?php if ($desc) : ?><div class="case-lead rise rise-3"><?php echo esc_html($desc); ?></div><?php endif; ?>
|
||||
|
||||
<?php if (is_array($sections) && $sections) : ?>
|
||||
<?php foreach ($sections as $sec) : ?>
|
||||
<div class="case-sec" data-reveal>
|
||||
<h2 class="case-sec-h"><span class="lime">/ </span><?php echo esc_html($sec['h']); ?></h2>
|
||||
<p class="case-sec-p"><?php echo esc_html($sec['p']); ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php
|
||||
/* Mode sections : les images de l'éditeur (captures) sont affichées en plus,
|
||||
sinon elles n'apparaîtraient nulle part. */
|
||||
preg_match_all('#<figure\b[^>]*wp-block-image[^>]*>.*?</figure>#s', apply_filters('the_content', get_the_content()), $yb_figs);
|
||||
if (!empty($yb_figs[0])) : ?>
|
||||
<div class="prose case-figs" data-reveal><?php echo implode("\n", $yb_figs[0]); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<div class="prose" data-reveal><?php the_content(); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($note) : ?><div class="note-l mono"><?php echo esc_html($note); ?></div><?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($next) : ?>
|
||||
<a class="case-next" href="<?php echo esc_url(get_permalink($next)); ?>" data-cursor-label="VOIR LE PROJET" data-wipe="<?php echo esc_attr(mb_strtoupper(yb2026_short_title($next))); ?>">
|
||||
<div>
|
||||
<div class="case-next-k mono">PROJET SUIVANT</div>
|
||||
<div class="case-next-name"><?php echo esc_html(yb2026_short_title($next)); ?></div>
|
||||
</div>
|
||||
<div class="case-next-arrow mono">→</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue