How this template on Wordpress?

Tell me, please, I have 2 templates for Wordpress, written by an Amateur.
I can not understand. As the Main set static page.

1 template page.php decorated like so:
<?php get_header(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>


In the 2nd entry template above does NOT work, and need a static page starts to appear only with this code:
<?php get_header(); ?>

<?php
if( have_posts() ){
 while( have_posts() ) {
the_post();
the_content();

}
}
?>

<?php get_footer(); ?>


What's the catch? I don't understand the second entry.. because in 1 case a generic code which definitely should work in all templates. Why it does not work with the second template?
June 26th 19 at 14:02
1 answer
June 26th 19 at 14:04
After the header write
<?php the_post(); ?>
nope, well it turns out then:

<?php get_header(); ?>

<?php the_post(); ?>

<?php get_footer(); ?>

Cap and basement derived, and the center of nothing. - christina commented on June 26th 19 at 14:07
<?php get_header(); ?>
<?php the_post(); ?>

<?php the_content(); ?>

<?php get_footer(); ?>
- Elvis.Wym commented on June 26th 19 at 14:10
Yes, it works.
But why in the first template,
<?php get_header(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>


and second only to

<?php get_header(); ?>
<?php the_post(); ?>
<?php the_content(); ?>
<?php get_footer(); ?>
- christina commented on June 26th 19 at 14:13
Unfortunately I ran out of license Vanga and say what it is without all the source code can not. - Elvis.Wym commented on June 26th 19 at 14:16

Find more questions by tags WordPress