get_posts from a category id doesn’t work
It’s ‘post_date’ not ‘date’ so $args = array( ‘numberposts’ => $items, ‘post_type’=>’portfolio’,’orderby’ => ‘post_date’,’order’=>’DESC’,’category’ => 5 ); $posts = get_posts($args); foreach($posts as $post){ setup_postdata($post); $return_html=”……”; } Should fix you up.