Reputation: 1630
I want to display all posts on a webpage, each post shall be wrapped in a div of the class="post". Where do I have to add the HTML in the loop?
PHP
<?php
query_posts('cat=5');
while (have_posts()) : the_post();
the_content();
endwhile;
?>
HTML
<div class="post"></div>
Upvotes: 0
Views: 40
Reputation: 34
How about this?
<?php
query_posts('cat=5');
while (have_posts()) : the_post();
echo '<div class="post">';
the_content();
echo '</div>';
endwhile;
?>
Upvotes: 1