You can achieve this functionality by executing a database query;
<?php $parent_posts= $wpdb->get_results( "SELECT ID, post_title FROM $wpdb->posts WHERE post_parent=0 AND post_type='page' AND post_status='publish' ORDER BY menu_order ASC" ); foreach($parent_posts as $record){ ?> <a href="<?php echo get_permalink($record->ID) ?>" > <h1><?php echo $record->post_title; ?></h1> </a> <p><?php echo $record->post_title;?></p> <?php } ?>
Note: - $wpdb is a global variable.
Janab source share