the_content() disappears on a static page
-
I have a custom template that was showing the content of the page that uses it and also a web form included in it. This works fine as:
<main><article> <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_content(); ?> <!-- Contact form --> <?php include('./includes/contact_form.php'); ?> <!-- End contact form --> <?php endwhile; ?> <?php endif; ?> </article></main>
but when I try to change the order so that the webform appears at the top of the page the other content disappears leaving just the web form on the page:
<main><article> <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <!-- Contact form --> <?php include('./includes/contact_form.php'); ?> <!-- End contact form --> <?php the_content(); ?> <?php endwhile; ?> <?php endif; ?> </article></main>
- The topic ‘the_content() disappears on a static page’ is closed to new replies.