I have a custom post type and a page like this for displaying the posts inside :
archive-(myCPT).php I've created 2 posts, and one of them is the child. How can I display just the parent page inside my archive-(myCPT).php
Here is a snippet from archive-(myCPT).php :
<?php
if( have_posts() ){
// normal blog layout
$x = 1;
while ( have_posts() ){
the_post();
get_template_part( 'inc/post-format/content-debate');
// advertising between posts
if($ad_posts_mode != 'none'){
// take into account ad frequency
if (($x % $ad_posts_frequency) == 0){
switch ($ad_posts_mode) {
case 'image':
echo '<div class="'.(($ad_posts_box) ? 'box' : '').' between_posts"><a target="_blank" href="'.of_get_option('ad_posts_image_link').'"><img src="'.of_get_option('ad_posts_image').'"></a></div>';
break;
case 'html':
echo '<div class="'.(($ad_posts_box) ? 'box' : '').' between_posts">'.apply_filters('shortcode_filter',do_shortcode(of_get_option('ad_posts_code'))).'</div>';
break;
}
}
}
$x++;
}
}