【问题标题】:Customize wordpress oEmbedd (soundcloud)自定义 wordpress oEmbedd (soundcloud)
【发布时间】:2015-10-22 21:12:35
【问题描述】:

我使用的是 Wordpress 4.3.1,我注意到它使用 oEmbed 自动嵌入来自 soundcloud 的曲目。

这太棒了!除了,我无法控制小部件的显示方式。

首先我想展示没有艺术品的“Classic Embed”。

其次,我希望小部件更宽。

如何在不编辑我的 wordpress 页面中每个帖子的简码的情况下实现这一点?

【问题讨论】:

    标签: wordpress soundcloud


    【解决方案1】:

    您可以添加过滤器来更改 oEmbed 代码的显示方式。下面是一些可以帮助您入门的内容:

    // this function is called on all urls surrounded by the WordPress embed shortcode. // i.e.: [embed]https://soundcloud.com/gratefuldead/grateful-dead-box-of-rain[/embed] function my_embed_options( $code ) { // look for SoundCloud link: if( strpos( $code, 'soundcloud.com') !== false ) { $code = str_replace( 'show_artwork=true', 'show_artwork=false', $code ); } return $code; } add_filter( 'embed_oembed_html', 'my_embed_options' );

    您可以找到 SoundCloud 播放器的完整参数列表here

    【讨论】:

      猜你喜欢
      • 2013-06-22
      • 2012-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多