I have a bootstrap 4 card columns masonry like grid. I want to show six posts form my articles and I'm using a custom query to retrieve the posts. All works fine, but the posts aren't showed with the order I want. I don't know if it's because the card columns bootstrap settings or because the wordpress query. Is there a simple way to order the loaded posts with a custom order?
here is the example of my wp query
<?php
$clients = ['199','168','86','291','113','229'];
$portfolio = new WP_Query(array(
'post_type' => 'post',
'status' => 'published',
'category_name' => 'Portfolio',
'posts_per_page'=> 6,
'post__in' => $clients
));
?>
<div class="card-columns">
<?php if( $portfolio->have_posts() ): while( $portfolio->have_posts() ): $portfolio->the_post(); ?>
<div class="card hide">
<a href="<?php the_permalink(); ?>">
<img class="card-img-top w-100" src="<?php the_post_thumbnail_url('full'); ?>" id="case-studies">
<div class="overlay"><h4 class="text-center" id="client-name"><?php the_title(); ?></h4></div>
</a>
</div>
<?php endwhile; ?>
<?php endif; wp_reset_postdata(); ?>
</div>
order
andorderby
parameters ofWP_Query
. codex.wordpress.org/Class_Reference/…orderby
param inWP_Query()
Thanks for the suggestion