Loading…

How to display custom Post in WordPress?

$args = array( 'post_type' => 'blog', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
   the_title();
   echo '<div class="entry-content">';
     the_content();
   echo '</div>';
endwhile;

Suggest An Answer

No suggestions avaliable!

Latest post from Wordpress Interview Questions

Ask Question