List all Posts

Outputs a single list of all your posts.

include "wp-load.php";

$posts = new WP_Query('post_type=post&posts_per_page=-1&post_status=publish');
$posts = $posts->posts;

foreach($posts as $post) {    
     $permalink = get_permalink($post->ID);
     echo "{$post->post_date} -- <a href='{$permalink}'>{$permalink}</a><br />";
}

Thanks, Mickey! (Edited a bit for simplicity)

Comments are closed.

Skip to toolbar