List 50 posts of wordpress.
September 20th, 2008 — adminIf you want to list 50 posts, use the following code:
<ul>
<?php
global $post;
$myposts = get_posts(’numberposts=-1′);
foreach($myposts as $post) :
?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
if you want to list all the posts, use the following codes:
<ul>
<?php
global $post;
$myposts = get_posts(’numberposts=5′);
foreach($myposts as $post) :
?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>