You’ll want to first set up a new query and enter the loop. Here’s how you would set up a query to retrieve only posts from your custom post type:
$args = array(
"post_type"=>"your-post-type",
"posts_per_page"=>"3"
);
$query = new WP_Query($args);
Then, you need to enter the loop in order to retrieve the data you’re looking for:
have_posts()): $query->while(have_posts()): $query->the_post(); ?>
<!-- Your content goes here -->
Then, you can just use standard WordPress loop functions like the_title();
and the_excerpt();
to display the content for the current item in the loop. Ideally, you would want a template kind of like this:
<h2><? the_title(); ?></h2>
<? the_post_thumbnail(); ?>
<p><? the_excerpt(); ?> - <a href="https://wordpress.stackexchange.com/questions/115528/<? the_permalink(); ?>">Read more</a>.</p>
Your mileage will vary. You can start with the above, and then theme the result with CSS to achieve the desired effect.
Here’s all the code:
<?
$args = array(
"post_type"=>"your-post-type",
"posts_per_page"=>"3"
);
$query = new WP_Query($args);
?>
<? if($query->have_posts()): $query->while(have_posts()): $query->the_post(); ?>
<h2><? the_title(); ?></h2>
<? the_post_thumbnail(); ?>
<p><? the_excerpt(); ?> - <a href="https://wordpress.stackexchange.com/questions/115528/<? the_permalink(); ?>">Read more</a>.</p>
<? endwhile; endif; ?>
Hopefully this helps!