order by post date and modified date posts both in wpquery

I am using a standard wp_query to load posts. My requirement is to display posts orderby post date and modified date both.

Which means if i added new post that also should show on top and if i modify any post that also should come on top.

How can this work?

$the_query = new WP_Query( array(
‘post_type’ => $post_type,
‘orderby’ => ‘modified’,
‘order’ => ‘DESC’,
));

Read more here:: order by post date and modified date posts both in wpquery

Leave a Reply

Your email address will not be published. Required fields are marked *