test on showing dbmob datas
This commit is contained in:
parent
021bbd6d8a
commit
40f5985f6b
58
template-parts/content-dbmod.php
Normal file
58
template-parts/content-dbmod.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Template part for displaying dbmod posts
|
||||
*/
|
||||
?>
|
||||
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class('dbmod-item'); ?>>
|
||||
<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="card-body">
|
||||
<h2 class="card-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 endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<a href="<?php the_permalink(); ?>" class="btn btn-primary">
|
||||
<?php _e('Voir plus', 'carhop'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
Loading…
Reference in New Issue
Block a user