添加soundcloud RSS feed到wordpress页面



也许不是正确的论坛,但我希望在wordpress网站的新页面上添加soundcloud频道rss提要的一些帮助。我已经尝试了一些rss提要聚合器,并将相关的短代码添加到页面,但它仍然不会在页面上显示单个轨道。我希望有他们渲染相同,因为他们会如果嵌入在一个帖子。

任何想法?

谢谢

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

我也会添加一个循环。

希望这对你有帮助。

$(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/

最新更新