why the_content in a wordpress loop prints extra tag <code>?

enter image description here

Below is a wordpress loop that prints the content “the_content” of all posts each in a DIV.

<html>
<head>
</head>
<body>
<?php if (have_posts()) :?>
    <?php  while (have_posts()) : ?>
        <?php the_post(); ?>
        <div><?php the_content() ; ?></div>
    <?php endwhile;?>
<?php endif;    ?>
</div>
</body>
</html>

the problelm is that last three posts get printed in a code section as bellow.

<code>
<code>
   the last three DIVs
</code>
</code>

Can you gide me how to fix this problem?

Read more here: why the_content in a wordpress loop prints extra tag <code>?

Leave a Reply

Your email address will not be published. Required fields are marked *