I created custom post type using cpt plugin and trying to create custom template to my new post type.
I want to display only parent posts
and then display child posts in parent post page, but when trying to get only parent post nothing appears
my code :
$args = array(
'post_type' => 'programs',
'post_parent' => get_the_ID(),
);
$article_posts = new WP_Query($args);
if($article_posts->have_posts()) :
?>
<?php while($article_posts->have_posts()) : $article_posts->the_post();
$post_id = get_the_ID();
$post_link = get_permalink($post_id);
$post_title = get_the_title();