SMILET
第一步:获取分类6下的所有posts12345$args = array( 'category' => 6, 'numberposts' => -1);$audio_posts = get_posts( $args );第二步:遍历$audio_posts获取对应附件1234567891011121314foreach( $audio_posts as $post ) { $audios = get_attached_media( 'audio', $post->ID ); if ( empty( $audios ) ) continue; $audio = reset( $audios ); $src = wp_get_attachment_url( $audio->ID ); if ( empty( $src ) ) continue; printf( '<a href="%1$s" title="%2$s">%3$s</a>', $src, $audio->post_title, $audio->post_title ); }思路如此,具体代码你再根据实际使用完善完善!