REFACTOR Clean up rendering logic in dbmob archives by removing unused variables and improving code structure
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e1eb9b428c
commit
1a2d2708ef
|
|
@ -37,24 +37,18 @@ $post_count = $query->found_posts;
|
|||
<?php if ($query->have_posts()) : ?>
|
||||
<div class="dbmob-grid">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<?php $maitron_url = get_field('maitron_url', get_the_ID()); ?>
|
||||
|
||||
<?php get_template_part('template-parts/components/cards/post-card', null, array(
|
||||
'ID' => get_the_ID(),
|
||||
'ID' => get_the_ID(),
|
||||
'current_post_type' => 'dbmob',
|
||||
'has_external_link' => isset($maitron_url) && !empty($maitron_url),
|
||||
'external_link' => $maitron_url,
|
||||
'external_link_text' => 'Voir la notice',
|
||||
)); ?>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($post_count > $initialPostDisplayAmount) : ?>
|
||||
<button class="load-more-button" data-offset="0" data-posts-per-page="-1">Afficher plus</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($post_count > $initialPostDisplayAmount) : ?>
|
||||
<button class="load-more-button" data-offset="0" data-posts-per-page="-1">Afficher plus</button>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,24 +37,18 @@ $post_count = $query->found_posts;
|
|||
<?php if ($query->have_posts()) : ?>
|
||||
<div class="dbmob-grid">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<?php $maitron_url = get_field('maitron_url', get_the_ID()); ?>
|
||||
|
||||
<?php get_template_part('template-parts/components/cards/post-card', null, array(
|
||||
'ID' => get_the_ID(),
|
||||
'ID' => get_the_ID(),
|
||||
'current_post_type' => 'dbmob',
|
||||
'has_external_link' => isset($maitron_url) && !empty($maitron_url),
|
||||
'external_link' => $maitron_url,
|
||||
'external_link_text' => 'Voir la notice',
|
||||
)); ?>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
</div>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($post_count > $initialPostDisplayAmount) : ?>
|
||||
<button class="load-more-button" data-offset="0" data-posts-per-page="-1">Afficher plus</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($post_count > $initialPostDisplayAmount) : ?>
|
||||
<button class="load-more-button" data-offset="0" data-posts-per-page="-1">Afficher plus</button>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user