How do I display only one post in each post_type

Question

Image

How can I order to display only one normal post for each post_type title on the front page.
I want each post_type to only display the last normal post updated.
so the results shown are only

  • post 1.3
  • post 2.2
  • post 3.3
  • and post 4.4

below is the code that I use to display posts based on certain post_type titles on the page ‘single-vid.php’

$slug = get_the_ID($post->ID, "vid", true); ?>
<?php
$recent = new WP_Query(array(
'showposts' => '1000',
'post_type' => 'post',
'meta_key' => 'snap_episode-vid',
'orderby' => 'date',
'meta_key' => 'snap_vid',
'meta_value' => $slug
)); if($recent->have_posts()) : while($recent->have_posts()) : $recent->the_post(); ?>
0
, , , james 2 years 2019-10-27T02:04:10-05:00 0 Answers 83 views 0

Leave an answer

Browse
Browse