REFactor archive templates: create new 'archive-dbmob.php' for dbmod post type, remove old 'archive-dbmod.php', and update content structure in 'content-dbmod.php' for improved layout and data presentation.
This commit is contained in:
parent
1063ed8cd1
commit
fb3a366421
49
archive-dbmob.php
Normal file
49
archive-dbmob.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The template for displaying archive pages for the dbmod post type
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div class="archive-dbmob">
|
||||
<div class="container">
|
||||
<div class="page-heading">
|
||||
<h1>
|
||||
<span class="acronyme">DBMOB</span>
|
||||
<span class="explanation"> Dictionnaire biographique du mouvement ouvrier en Belgique</span>
|
||||
</h1>
|
||||
<p>Découvrez notre rôle au sein du projet DBMOB et explorez les notices biographiques réalisées par l’équipe du CARHOP. Ces portraits de militant·e·s retracent leurs engagements et contributions. </p>
|
||||
</div>
|
||||
|
||||
<div class="post-grid">
|
||||
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<?php get_template_part('template-parts/content', 'dbmod'); ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<?php
|
||||
the_posts_pagination(array(
|
||||
'mid_size' => 2,
|
||||
'prev_text' => __('Précédent', 'carhop'),
|
||||
'next_text' => __('Suivant', 'carhop'),
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
<div class="col-12">
|
||||
<?php get_template_part('template-parts/content', 'none'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The template for displaying archive pages for the dbmod post type
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1 class="archive-title"><?php echo post_type_archive_title('', false); ?></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php while (have_posts()) : the_post(); ?>
|
||||
<div class="col-md-4 mb-4">
|
||||
<?php get_template_part('template-parts/content', 'dbmod'); ?>
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
|
||||
<div class="col-12">
|
||||
<?php
|
||||
the_posts_pagination(array(
|
||||
'mid_size' => 2,
|
||||
'prev_text' => __('Précédent', 'carhop'),
|
||||
'next_text' => __('Suivant', 'carhop'),
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php else : ?>
|
||||
<div class="col-12">
|
||||
<?php get_template_part('template-parts/content', 'none'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
.primary-menu-container {
|
||||
@apply mx-auto
|
||||
bg-primary
|
||||
|
||||
text-white
|
||||
relative
|
||||
h-fit
|
||||
|
|
@ -35,11 +35,17 @@
|
|||
xl:pr-24;
|
||||
}
|
||||
|
||||
li.menu-item:has(.page_icon) {
|
||||
@apply flex flex-col items-center justify-center gap-3;
|
||||
.page_icon {
|
||||
@apply w-12 h-12 object-contain;
|
||||
}
|
||||
}
|
||||
/* Highlight using list element */
|
||||
li.current-page-parent > a,
|
||||
li.current_page_item > a {
|
||||
@apply font-medium
|
||||
text-white
|
||||
!text-white
|
||||
decoration-secondary
|
||||
underline
|
||||
underline-offset-8;
|
||||
|
|
@ -55,7 +61,7 @@
|
|||
@apply cursor-pointer
|
||||
underline
|
||||
underline-offset-8
|
||||
text-secondary;
|
||||
!text-white;
|
||||
}
|
||||
a:focus {
|
||||
text-decoration: none;
|
||||
|
|
@ -65,7 +71,7 @@
|
|||
.menu-item-submenu-toggle {
|
||||
&:hover,
|
||||
&:focus {
|
||||
@apply text-secondary;
|
||||
@apply !text-white;
|
||||
}
|
||||
@apply relative pr-4;
|
||||
&:after {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,14 @@
|
|||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('dbmod-item'); ?>>
|
||||
<?php
|
||||
$chapo = get_field('chapo');
|
||||
$content = get_field('content');
|
||||
$author = get_field('author');
|
||||
$maitron_url = get_field('maitron_url');
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('post-card-dbmod'); ?>>
|
||||
<div class="card h-100">
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<div class="card-img-top">
|
||||
|
|
@ -13,40 +20,30 @@
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">
|
||||
<div class="post-card-dbmod__content">
|
||||
<h2 class="post-card-dbmod__title">
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php the_title(); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<div class="card-text">
|
||||
<?php the_excerpt(); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Afficher les champs ACF si présents
|
||||
if (function_exists('get_field')) :
|
||||
// Exemple d'affichage de champs ACF
|
||||
$marque = get_field('marque');
|
||||
$modele = get_field('modele');
|
||||
$annee = get_field('annee');
|
||||
?>
|
||||
|
||||
<div class="dbmod-details">
|
||||
<?php if ($marque) : ?>
|
||||
<p class="marque">Marque: <?php echo esc_html($marque); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($modele) : ?>
|
||||
<p class="modele">Modèle: <?php echo esc_html($modele); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($annee) : ?>
|
||||
<p class="annee">Année: <?php echo esc_html($annee); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if ($author) : ?>
|
||||
<p class="author">par :<?php echo esc_html($author); ?></p>
|
||||
<?php endif; ?>
|
||||
<div class="post-card-dbmod__details">
|
||||
|
||||
<?php if ($chapo) : ?>
|
||||
<p class="chapo"><?php echo esc_html($chapo); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($content) : ?>
|
||||
<p class="content"><?php echo esc_html($content); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($maitron_url) : ?>
|
||||
<p class="maitron_url">Maitron URL: <?php echo esc_html($maitron_url); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user