#StackBounty: #php #shortcode #xml How to limit the content coming from wordpress shortcodes?

Bounty: 50

I am working on a wordpress shortcodes in which I want to the limit the content coming from a xml.

The code which I have used for wordpress shortcodes is:

function podcast_func( $content = null ){
    ob_start();
    ?>
https://content.jwplatform.com/libraries/FZ8yNTef.js
<center>
</center> var PodcastplayerInstance = jwplayer("podcast"); PodcastplayerInstance.setup({ playlist: "http://www.cpac.ca/tip-podcast/jwplayer.xml", androidhls: true, preload: "auto", height: 200, width: 400, visualplaylist:false, stretching: "fill", "plugins": { "http://www.cpac.ca/tip-podcast/listy.js":{}, 'viral-2': {'oncomplete':'False','onpause':'False','functions':'All'} } }); <?PHP return ob_get_clean(); } add_shortcode( 'podcast', 'podcast_func' );

On using this

[podcast]

, it displays the entire content from here http://www.cpac.ca/tip-podcast/jwplayer.xml

Problem Statement: I am wondering what changes I should make in the wordpress shortcode above so that it displays only 1st two items from here http://www.cpac.ca/tip-podcast/jwplayer.xml


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.