How to dynamically print post and page content to the WordPress Theme?

In your page.php, add the following code to dynamically fetch data (in loop) from the WordPress database.


if ( have_posts() ):
while( have_posts() ): the_post();
?>           

endif;
?