posts ";
$sql .= "WHERE post_status = 'publish'";
$sql .= " AND post_type = 'post' ";
$sql .= "ORDER BY post_date DESC";
$posts = $wpdb->get_results($sql);
print "
\n";
if (!empty($posts))
{
foreach ($posts as $post)
{
if ($post->monthyear != $previous)
{
$previous = $post->monthyear;
print '- ' . $post->monthyear . '
';
print "\n";
}
print '- ' . $post->day . ': ' . $post->post_title . '
';
print "\n";
}
}
else
{
print "- Posts
\n";
print "- None available
\n";
}
print "
\n";
return;
}
?>