0815

Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

List all of Your Site’s Posts

If the default wp_get_archives(type=postbypost&limit=) function doesn’t provide enough flexibility to meet your needs, here is another way to list all of your site’s posts:

<?php while(have_posts()) : the_post(); ?>
<ul>
	<?php $allposts = get_posts('numberposts=-1&offset=0'); foreach($allposts as $post) : ?>

	<li><?php the_time('d/m/y'); ?>: <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>

	<?php endforeach; ?>
</ul>
<?php endwhile; ?>

In place, that code will display a list of all of your blog’s posts. As a bonus, you may use any of the applicable parameters available to the get_posts() function to do just about anything you need with your posts list.

Source: WPRecipes.com




0