display the_content with setup_postdata

<?php

global $more;

$cat= 3;
$posts = get_posts ("cat=$cat&showposts=5");
if ($posts) {
foreach ($posts as $post):
$more = false;
setup_postdata($post);
?>
<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<p class="storycontent"><?php the_content('Read more...'); ?></p>
<?php
endforeach;
$more = true;
}

?>

Comments

Popular posts from this blog

PHP: Date Difference for PHP 5.2

HTML5 video loop src change on end play function