posts WHERE post_type = 'attachment' AND post_author = " . $userdata->ID . " ORDER BY post_modified DESC"; } else { $attachments_sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_modified DESC"; } $attachment_files = $wpdb->get_results( $attachments_sql ); // ================ // = IMAGES FIRST = // ================ echo '
'; // ========== // = VIDEOS = // ========== echo ''; // ============= // = DOCUMENTS = // ============= echo ''; // ========= // = AUDIO = // ========= echo '';