前言介紹
- 這款 WordPress 外掛「Featured Audio」是 2016-07-11 上架。
- 目前有 600 個安裝啟用數。
- 上一次更新是 2024-07-12,距離現在已有 295 天。
- 外掛最低要求 WordPress 4.5 以上版本才可以安裝。
- 有 3 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
audio | media | music | podcast |
內容簡介
WordPress原生支援特色圖片,使得使用者可以用不同的方式來將圖片與文章做結合,以符合所使用佈景主題的需求。本外掛可類似地支援音訊特色,讓所有使用WordPress來發佈音訊的人,都能以更有結構性的方式,在文章或頁面中特色呈現音訊檔案。每個文章和頁面都會有一個「特色音訊 metabox」,用戶可以透過這個方塊,上傳或從媒體庫中選擇要顯示特色的音訊檔案。
預設情況下,特色音訊會顯示在文章或頁面的頂部(在 the_content 內)。開發人員可以透過以下幾種 API 函數,新增佈景主題對於特色音訊的相關支援:
為何要使用特色音訊而非直接將音訊嵌入文章中呢?透過特色音訊的結構方式,可以使得您能夠隨意地自定義用戶在您的網站中聆聽音訊所體驗的方式,而具有無窮的可能性。本外掛附帶了一個特色音訊播放清單 widget 的例子,只要將此 widget 加入側邊欄,它就會自動顯示目前可以檢視到的所有已發佈文章中所顯示的音訊播放清單(如在主網誌頁面或類別頁面中顯示多則文章的檢視畫面);本外掛也支援最新音訊播放清單 widget,操作方式類似於最新文章 widget。
如果您需要更全面的方法來進行WordPress音樂管理,特別是需要在音訊旁邊加入譜面,可以參考Sheet Music Library外掛。
以下為開發人員所使用的API函數:
新增佈景主題支援
add_theme_support( 'featured-audio' )
透過新增佈景主題的特色音訊支援,即可決定是否要讓本外掛自動在內容中新增特色音訊。如果不想要,您可以透過 the_featured_content() 函數 (詳細請參閱以下內容) 在文章中特別指定位置新增特色音訊。
更改支援的文章類型
預設支援「文章」和「頁面」的文章類型。您可以使用 featured_audio_post_types 中所提供的過濾器來修改該列表,例如:
add_filter( 'featured_audio_post_types', 'prefix_featured_audio_post_types' );
function prefix_featured_audio_post_types( $post_types ) {
//新增對 sheet_music 文章類型的支援
$post_types[] = 'sheet_music';
// 覆寫整個列表,並刪除頁面支援
$post_types = array( 'post' );
return $post_types;
}
the_featured_audio( $args )
透過這個函數可顯示特色音訊,假如它存在於文章中。
參數:
$args array 顯示選項。
$args['id'] int 文章ID(選用)。預設值為目前文章ID。
$args['album_art'] boolean 是否顯示特色音訊的唱片封面圖片。預設值:false。
$args['album_art_size'] string 唱片封面圖片的尺寸。預設值:縮略圖。
$args['title'] boolean 是否顯示音訊附件標題。預設值為 false。
get_the_featured_audio( $args )
透過此函數可取得特色音訊,假如它存在於文章中,並且以字串的方式呈現,與 the_featured_audio() 函數具有相同參數。
get_featured_audio_src( $id )
如果存在特色音訊檔案,此函數可回傳特色音訊檔案的URL。
參數:
$id int 文章ID(選用)。預設值為目前文章ID。
get_featured_audio_attachment_id( $id )
如果存在特色音訊附件,此函數可回傳該音訊附件的ID。
參數:
$id int 文章ID(選用)。預設值為目前文章ID。
get_the_featured_audio_playlist()
此函數會回傳可以顯示的最新音訊播放清單。
原文外掛簡介
WordPress supports featured images out of the box, allowing images to represent posts in various ways defined by the theme. This plugin adds similar support for audio, allowing musicians, podcasters, and anyone who publishes audio with WordPress to feature audio files on posts and pages in a structured way. Each post and page gets a featured audio metabox where an audio file can be uploaded or selected from the media library.
By default, featured audio is displayed at the top of posts and pages (within the_content). Developers can change this by adding theme support for featured-audio, via several API functions listed below.
Why use featured audio instead of embeding audio directly into posts? Featured audio organizes the content in a structured way, alowing infinite possibilities to customize the way users experience audio content on your site. The plugin ships with one example of this – the featured audio playlist widget. Add this widget to your sidebar and it’ll automatically display a playlist of all of the audio files featured on posts shown on the current view, on views with more than one post such as the main blog page or a category page. The plugin also supports a recent audio playlist widget, which behaves similarly to a latest posts widget.
For a more comprehensive way to manage music with WordPress, particularly if you need to include sheet music alongisde audio, see the Sheet Music Library plugin.
Developer API Functions
Add Theme Support
add_theme_support( 'featured-audio' )
Adding theme support for featured audio tells the plugin not to add the featured audio to the content automatically. Instead, you can add featured audio exactly where you want it with the_featured_content() (see below for details).
Change Supported Post Types
By default, the post and page post types are supported. You can use the featured_audio_post_types filter to modify this list. For example:
add_filter( 'featured_audio_post_types', 'prefix_featured_audio_post_types' );
function prefix_featured_audio_post_types( $post_types ) {
// Add support to the sheet_music post type.
$post_types[] = 'sheet_music';
// Overwrite the entire list to remove support on pages.
$post_types = array( 'post' );
return $post_types;
}
the_featured_audio( $args )
Display the featured audio, if it exists.
Parameters:
$args array Display options.
$args['id'] int Post id (optional). Defaults to current post id.
$args['album_art'] boolean Whether to display the album art for the featured audio cycle. Default: false.
$args['album_art_size'] string Size to use for the album art picture. Default: thumbnail.
$args['title'] boolean Whether to display the title of the audio attachment. Default: false.
get_the_featured_audio( $args )
Get the featured audio, if it exists, as a string. Has the same arguments as the_featured_audio().
get_featured_audio_src( $id )
Returns the url of the featured audio file, if it exists.
Parameter:
$id int Post id (optional). Defaults to current post id.
get_featured_audio_attachment_id( $id )
Returns the id of the featured audio attachment, if it exists.
Parameter:
$id int Post id (optional). Defaults to current post id.
get_the_featured_audio_playlist()
Get the featured audio playlist, if there are multiple posts with featured audio in the current query. Used by the featured audio playlist widget.
the_featured_audio_playlist()
Displays (echoes) get_the_featured_audio_playlist().
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Featured Audio」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
PowerPress Podcasting plugin by Blubrry 》rPress 是 WordPress 的第一個播客外掛程式。這個播客外掛程式由播客製作者(Blubrry Podcasting)專為播客製作者設計,能夠直接從您的 WordPress 網站發布和...。
Seriously Simple Podcasting 》.com/article/142-how-to-use-the-seriously-simple-podcasting-wordpress-plugin-with-castos" rel="nofollow ugc">Castos-SSP Sync to automatically updat...。
Podcast Player – Your Podcasting Companion 》on of these control buttons provides a complete and customizable listening experience for your audience., The Playlist feature of the Podcast Playe...。
AudioIgniter Music Player 》正在尋找 MP3 音樂播放器嗎?AudioIgniter 可讓您創建音樂播放列表並將其嵌入 WordPress 文章、頁面或自定義文章類型中。通過使用標准的 WordPress 媒體上傳...。
Podlove Podcast Publisher 》我們開發了 Podlove Podcast Publisher 外掛,因為現有的解決方案過時、複雜且難以操作。此外掛可以幫您節省時間,減少煩惱,並為您的聽眾提供尖端的聆聽體驗...。
Podcast Subscribe Buttons 》這個外掛能夠幫助您在網站上任意位置輕鬆地加入60多個自定義和播客專屬的訂閱(關注)按鈕,只需使用簡單的短碼即可。播客訂閱按鈕專為播客製作者而設計,因...。
WPaudio MP3 Player 》其他所有的 WordPress MP3 播放器都很爛或很醜,所以我做了一個更好的。, , WPaudio 是一個簡單的 MP3 播放器。其極簡的設計適用於任何博客。使用起來非常容...。
Podcast Importer SecondLine 》使用 Podcast Importer SecondLine 外掛,自動同步播客 RSS 供稿到 WordPress 網站。此外掛容易將播客匯入 WordPress,可將播客匯入常規 WordPress 文章或自...。
Podlove Subscribe button 》這個外掛可以輕鬆地加入 Podlove 訂閱按鈕。使用簡單的小工具把它放在側邊欄,或使用簡單的短碼在頁面和/或文章中包含按鈕。, 關於 Podlove 訂閱按鈕, Podlov...。
Libsyn Publisher Hub 》需要 Libsyn 主機帳戶, 尚未使用 Libsyn 進行主機服務嗎?請至http://www.libsyn.com註冊,或透過support@li&...。
SpeakPipe – Voicemail for Websites 》透過 SpeakPipe,您可以在您的網站上直接從聽眾那收到語音留言。將 SpeakPipe 安裝在網站上非常容易,只需不到一分鐘的時間即可完成。訪客無需使用 SpeakPipe...。
Seriously Simple Transcripts 》, 這款外掛是 Seriously Simple Podcasting 的附加組件,需使用至少 v1.14.8 的 Seriously Simple Podcasting版本才能正常運作。, , Seriously Simple Podcas...。
Seriously Simple Speakers 》, 這個外掛是 Seriously Simple Podcasting 的附加元件,需至少安裝版本為 v1.14 的 Seriously Simple Podcasting 才能使用。, , 你的播客節目中是否有多位不...。
Play.ht – Make Your Blog Posts Accessible With Text to Speech Audio 》Play.ht 可協助您將文章、部落格文章、課程以及幾乎所有書面內容轉換為語音檔,讓使用者可以聽取您的內容。 Play.ht 使用最先進的文字轉語音技術和 SEO 友好...。
Meks Audio Player 》輕鬆增強您的播客、音樂或任何網站上的音訊。Meks Audio Player 最初是為我們的 Megaphone 主題 提供支援,但現在它可以用於在任何 WordPress 網站上播放音訊...。