FEATURE Handling a variation for the post type analyse-etude post types to get the two last analyse and etude with a dedicated function
This commit is contained in:
parent
95f21975bc
commit
44a6c0ef03
|
|
@ -10,6 +10,12 @@ $posts_query = new WP_Query(array(
|
|||
'order' => 'DESC',
|
||||
|
||||
));
|
||||
|
||||
if ($post_type === 'analyses-etudes') :
|
||||
$posts_query = get_last_analyses_etudes_posts();
|
||||
endif;
|
||||
|
||||
|
||||
$posts = $posts_query->posts;
|
||||
$current_post_type = $args['current_post_type'] ?? get_post_type();
|
||||
|
||||
|
|
@ -24,8 +30,8 @@ $current_post_type = $args['current_post_type'] ?? get_post_type();
|
|||
<?php endif; ?>
|
||||
|
||||
<?php foreach ($posts as $post) : ?>
|
||||
<?php get_template_part('template-parts/components/post-card', null, array(
|
||||
'ID' => get_the_ID(),
|
||||
<?php get_template_part('template-parts/components/cards/post-card', null, array(
|
||||
'ID' => $post->ID,
|
||||
)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user