i have custom post type events. i want to display content from single post and using single-events.php .
The code in single-events.php is

<?php get_header(); ?>
<?php $args = array( 'post_type' => 'events',
              $loop = new WP_Query( $args );
  if($loop->have_posts()):while ( $loop->have_posts() ) : $loop->the_post();  ?>
<?php the_content( ); ?>
<?php endwhile;endif; ?>    
<?php get_footer(); ?>

But its displaying the content from all of the posts of custom type- ‘events': how do i display the post from just single post

Read more here: Display single custom post


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , ,

Wordpress related questions and answers: