The get_posts()
argument is supposed to be numberposts
not posts_per_page
and you were passing it as string. Try making it an integer.
function listposts( $atts ) {
$atts = shortcode_atts( array(
'tag' => 'jan-2011',
'numberposts' => -1,
'orderby' => 'post_date',
'order' => 'asc',
'post_status' => 'any'
), $atts );
$catposts = get_posts( $atts );
$out="";
foreach( $catposts as $single ) {
$out .= "{$single->post_title}<br />";
}
return $out;
}
add_shortcode( 'list', 'listposts' );