I am using page template to fetch data from a custom post type. page name is client
and template name is client-template.php
inside page-templates folder.
this is code in client-template .
<?php
/**
* Template Name: Client Template
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>
<?php get_header();?>
<div id="main-content" class="main-content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
$args=array('post_type' => 'clients');
$query= new WP_Query($args);
// Start the Loop.
while ($query-> have_posts() ) : $query->the_post();
echo the_title();
echo the_post_thumbnail();
endwhile;
?>
</div><!-- #content -->
</div><!-- #primary -->
</div><!-- #main-content -->
Now, this is fetching data and shows it. but, header is not getting included whats wrong here , I used types plugin to create post type and then selected above mentioned template for client page. Please help me with this.