REFACTOR Moving the card into the components subfolder
This commit is contained in:
parent
b69d85eec8
commit
1e62d7b38c
55
template-parts/post-types/content-dbmod.php
Normal file
55
template-parts/post-types/content-dbmod.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Template part for displaying dbmod posts
|
||||
*/
|
||||
?>
|
||||
|
||||
<?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">
|
||||
<?php the_post_thumbnail('medium', array('class' => 'img-fluid')); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="post-card-dbmod__content">
|
||||
<h2 class="post-card-dbmod__title">
|
||||
<a href="<?php the_permalink(); ?>">
|
||||
<?php the_title(); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<?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">
|
||||
<a href="<?php the_permalink(); ?>" class="btn btn-primary">
|
||||
<?php _e('Voir plus', 'carhop'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
48
template-parts/post-types/template-dbmob.php
Normal file
48
template-parts/post-types/template-dbmob.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/* Template Name: DBmob */
|
||||
|
||||
|
||||
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(); ?>
|
||||
Loading…
Reference in New Issue
Block a user