【问题标题】:add soundcloud rss feed to wordpress page将 soundcloud RSS 提要添加到 wordpress 页面
【发布时间】:2014-05-13 15:11:49
【问题描述】:

也许不是正确的论坛,但我希望在将 soundcloud 频道 rss 提要添加到 wordpress 网站的新页面上得到一些帮助。我已经尝试了许多 rss 提要聚合器并将相关的短代码添加到页面,但它仍然不会显示页面上的各个轨道。我希望让它们呈现与嵌入帖子时相同的效果。

有什么想法吗?

谢谢

【问题讨论】:

    标签: wordpress soundcloud


    【解决方案1】:

    一种快速而简单的方法可能是这样的,您需要将此脚本添加到页面或修改模板、页面 - 取决于您的设置。

    我也会添加一个循环。

    希望对你有所帮助。

    $(function(){
            url = 'http://feeds.soundcloud.com/users/soundcloud:users:46971334/sounds.rss';
            $.ajax({
            type: "GET",
            url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' + encodeURIComponent(url),
            dataType: 'json',
            error: function(){
                alert('Unable to load feed, Incorrect path or invalid feed');
            },
            success: function(xml){
                values = xml.responseData.feed.entries;
    
                $('#feeditems').append('<iframe width="300" height="300" scrolling="no" frameborder="no"                                   src="https://w.soundcloud.com/player/?url=' + values[0].link + '&amp;auto_play=false&amp;hide_related=false&amp;visual=true"></iframe>');
    
     $('#feeditems').append('<br/>');
    
     $('#feeditems').append('<iframe width="300" height="300" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=' + values[1].link + '&amp;auto_play=false&amp;hide_related=false&amp;visual=true"></iframe>');
    
            }
        });
        });
    

    http://jsfiddle.net/iambnz/WC5Q9/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-25
      • 1970-01-01
      • 2020-02-05
      • 2019-04-18
      • 1970-01-01
      • 2014-03-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多