Here is the code to get your custom post type posts. you can put something which you want to print like your post content, your post title, featured image and etc under the while loop.
'news', // Change news as your post type
'post_status' => 'publish',
'cat' => '3', // Change 3 as your cat id
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
// do something
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
?>
0 Comment(s)