banner-image

Display post type using WP Query

If you want to display any wordpress custom post type using the WP Query, you have to follow the below method.

Using the below while-loop query, you can call any post types data.

$wp_query = new WP_Query( array( 'post_type' => 'post_type_name','showposts' => '3', 'order'=>'ASC') ); //replace post_type_name with yours post type name
while ($wp_query->have_posts()) : $wp_query->the_post();
  the_title();
  the_content();
endwhile;

 

For more details, visit here.

Do You Want To Boost Your Business?

drop us a line and keep in touch