一个用户向我们询问在WordPress网站中嵌入SoundCloud的简单方法。WordPress一个很好的功能就是oEmbed ,在代码行中贴入URL就可自动嵌入。目前WordPress oEmbed library 支持多种流行的服务如Youtube、 Twitter、 Vimeo等。然而,WordPress目前还不支持SoundCloud。但也无需担心,WordPress 启用wp_oembed_add_provider()功能,用户可轻松地在网站中添加oEmbed提供商。本文将展示如何在WordPress中添加oEmbed以支持SoundCloud。我们只要在主题functions.php文件或site-specific插件中贴入以下代码。 // Add SoundCloud oEmbed 

一个用户向咱们问询在WordPress网站中嵌入SoundCloud的简略办法。WordPress一个很好的功用便是oEmbed,在代码行中贴入URL就可主动嵌入。现在WordPress oEmbed library 支撑多种盛行的服务如Youtube、 Twitter、 Vimeo等。但是,WordPress现在还不支撑SoundCloud。但也无需忧虑,WordPress 启用wp_oEmbed_add_provider()功用,用户可轻松地在网站中增加oEmbed提供商。本文将展现如安在WordPress中增加oEmbed以支撑SoundCloud。咱们只要在主题functions.php文件或site-specific插件中贴入以下代码。

怎么嵌入在你的WordPress博客SoundCloud运用oEmbed(wordpress添加音乐)  oEmbed SoundCloud WordPress 使用 使用技巧 博客 新闻资讯 第1张

// Add SoundCloud oEmbed

function add_oembed_SoundCloud(){

wp_oembed_add_provider( 'http://soundcloud.com/*', 'http://soundcloud.com/oembed' );

}

add_action('init','add_oembed_soundcloud');


比较盛行的插件SoundCloud支撑多种功用。因为WordPress.com 官网不支撑SoundCloud,WordPress.com用户可写入简略的代码。经过WordPress支撑的JetPack插件,发动shortcode嵌入选项。完结设置之后,您就能够运用以下简略代码:

[soundcloud url="http://api.soundcloud.com/tracks/207988" iframe="true"/]

期望对寻觅在WordPress中嵌入SoundCloud的用户
有所协助。

转载请说明出处
知优网 » 怎么嵌入在你的WordPress博客SoundCloud运用oEmbed(wordpress添加音乐)

发表评论

您需要后才能发表评论