$args['post_type'], /* to here */ 'post_status' => $args['status'], 'orderby' => 'date', 'order' => $args['order'], 'posts_per_page' => intval( $args['max'] ), 'no_found_rows' => true, 'cache_results' => false ); $posts = new WP_Query( $query_args ); if ( $posts->have_posts() ) { echo '
'; echo '

' . $args['title'] . '

'; echo ''; echo '
'; } else { return false; } wp_reset_postdata(); return true; } // The replacement widget function anno_custom_wp_dashboard_site_activity() { echo '
'; $future_posts = anno_wp_dashboard_recent_post_types( array( 'post_type' => 'post', 'display' => 5, 'max' => 5, 'status' => 'future', 'order' => 'ASC', 'title' => __('Future Posts', 'anno'), 'id' => 'future-posts', ) ); $recent_posts = anno_wp_dashboard_recent_post_types( array( 'post_type' => 'post', 'display' => 5, 'max' => 5, 'status' => 'publish', 'order' => 'DESC', 'title' => __('Recent Posts', 'anno'), 'id' => 'published-posts', ) ); $recent_posts .= anno_wp_dashboard_recent_post_types( array( 'post_type' => 'article', 'display' => 5, 'max' => 5, 'status' => 'publish', 'order' => 'DESC', 'title' => __('Recent Articles', 'anno'), 'id' => 'published-posts', ) ); $recent_comments = wp_dashboard_recent_comments( 10 ); if ( !$future_posts && !$recent_posts && !$recent_comments ) { echo '
'; echo '

'; echo '

' . __('No activity yet!', 'anno') . '

'; echo '
'; } echo '
'; }