slidr_loop()

Here you can see some examples of the slidr_loop() function.

For instructions on how to use it, view the Slidr’s FAQ or check the plugin’s documentation from within the WordPress Admin.

YouTube videos

Loading...

Code:

// Your custom loop
function videos_loop() {
	$myloop = array('n64TMQH0rxg', 'JwYX52BP2Sk', 'Ahr4KFl79WI', 'yFAnn2j4iB0', '6fMnF0Fvdpo', 'dFh71_ftxLE');
	$output = '';
	foreach ($myloop as $item) {
		$output .= '<div class="slidr-item" style="height: 290px;max-height: none;"><iframe width="420" height="315" src="https://www.youtube.com/embed/' . $item . '" frameborder="0" allowfullscreen></iframe></div>';
	}
	return $output;
}

// Call slidr_loop() function
echo slidr_loop('videos_loop', '', '', '', true);

Google Maps

Loading...

Code:

// Your custom loop
function maps_loop() {
	$myloop = array(
	'Athens', 'Berlin', 'Barcelona', 'New York', 'Preveza');
	$output = '';
	foreach ($myloop as $item) {
		$output .= '<div class="slidr-item" style="height: 290px;max-height: none;border: 6px solid #aaa; box-shadow: 1px -1px 6px #ccc; "><iframe src="https://maps.google.com/maps?hl=en&q='.$item.'&ie=UTF8&t=roadmap&z=14&iwloc=B&output=embed" width="300" height="290" frameborder="0" style="border:0" allowfullscreen></iframe></div>';
	}
	return $output;
}

// Call slidr_loop() function
echo slidr_loop('maps_loop', '', '', '', true);

Posts from Sky News's feed

Code:

// Your custom loop
function skynews_loop() {
	$rss = simplexml_load_file('http://www.skysports.com/rss/0,20514,11959,00.xml');
	$output = '';
	foreach ($rss->channel->item as $item) {
		$output .= '<div class="slidr-item" style="width: 200px; height: 190px; max-height: none;background: url('.(string)$item->enclosure['url'][0].'); 	background-size: cover;"><h2 style="font-size: 18px; padding: 1em; margin: 0;text-align: center;"><a style="color: #fff;" target="_blank" href="'. $item->link .'">' . $item->title . "</a></h2></div>";
	} 
	return $output;
}

// Call slidr_loop() function
echo slidr_loop('skynews_loop', '200', '', 'auto', true);