[Plugin: Pinterest RSS Widget] Call several urls
-
Hi,
The Plugin Pinterest RSS Widget get rss feed from Pinterest and create a gallery like this.
Unfortunatly, Pinterest RSS feed include only 25 items.
To bypass it, I would like to call multiple Pinterest RSS feeds.
The original plugin works with a shortcode :
[prw username=”username” boardname=”bordname” maxfeeds=”1″ divname=”filmsrate1″ printtext=”1″ target=”newwindow” useenclosures=”yes” thumbwidth=”212″ thumbheight=”250″ showfollow=”no”]
With this associated PHP code
‘function get_pins_feed_list($username, $boardname, $maxfeeds=25, $divname=’standard’, $printtext=NULL, $target=’samewindow’, $useenclosures=’yes’, $thumbwidth=’150′, $thumbheight=’150′, $showfollow=’large’) {
// This is the main function of the plugin. It is used by the widget and can also be called from anywhere in your theme. See the readme file for example.// Get Pinterest Feed(s)
include_once(ABSPATH . WPINC . ‘/feed.php’);
if( empty($boardname) ){
$pinsfeed = ‘https://pinterest.com/’.$username.’/feed.rss’;
}
else $pinsfeed = ‘https://pinterest.com/’.$username.’/’.$boardname.’/rss’;// Get a SimplePie feed object from the Pinterest feed source
$feedsarray = split(‘,’,$feedslist);
$rss = fetch_feed($pinsfeed);
if($rss instanceof WP_Error) return ”;
$rss->set_timeout(60);// Figure out how many total items there are.
$maxitems = $rss->get_item_quantity((int)$maxfeeds);// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0,Y);
shuffle($rss_items);
reset($rss_items);
// now from that Y items, slice the array down to the maxitems
if( (count($rss_items) > $maxitems))$rss_items = array_slice($rss_items, 0, $maxitems);’I would like to modify the code to be able to call several boards :
[prw username=”username” boardname1=”bordname1″ boardname2=”bordname2″ … boardnameX=”bordnameX” maxfeeds=”1″ divname=”filmsrate1″ printtext=”1″ target=”newwindow” useenclosures=”yes” thumbwidth=”212″ thumbheight=”250″ showfollow=”no”]
But I don’t know how to modify the php code :
‘// Get Pinterest Feed(s)
include_once(ABSPATH . WPINC . ‘/feed.php’);
if( empty($boardname) ){
$pinsfeed = ‘https://pinterest.com/’.$username.’/feed.rss’;
}
else $pinsfeed = ‘https://pinterest.com/’.$username.’/’.$boardname1.’/rss’;’
‘https://pinterest.com/’.$username.’/’.$boardname2.’/rss’;
‘https://pinterest.com/’.$username.’/’.$boardnameX.’/rss’;Could you help me ?
Lucas
The topic ‘[Plugin: Pinterest RSS Widget] Call several urls’ is closed to new replies.