I am making a custom shortcode which basically is just meant to return my custom post type, here's my code:
function shortcode_slider($atts, $content=null){
extract(shortcode_atts( array('id' => ''), $atts));
$return = $content;
$return .= query_posts( array( 'post_status' => 'publish' , 'post_type' => 'slider' ) );
return $return;
}
add_shortcode('slider', 'shortcode_slider');
The shortcode works ok apart from one thing - when it returns all of the posts it also returns "array" at the top of the list - any idea why this would happen?
Also, I want to be able to use the "id" input to be able to specify a category, e.g.
$return .= query_posts( array( 'post_status' => 'publish' , 'post_type' => 'slider', 'category' => $id ) );
but I am unsure of the correct syntax for this.
Any help is much appreciated.


