Hello. I am trying to add an image feed from Tublr onto my wordpress site. I created a custom page template and added this code to get the feed:
[php]<?php
include_once(ABSPATH . WPINC . ‘/rss.php’);
$feed = ‘http://example.com/feed/’;
$rss = fetch_feed($feed);
if (!is_wp_error( $rss ) ) :
$maxitems = $rss->get_item_quantity(3);
$rss_items = $rss->get_items(0, $maxitems);
if ($rss_items):
echo “
- \n”;
- ’;
echo ‘’ . $item->get_title() . “\n”;
echo ‘’ . $item->get_description() . “
\n”;
foreach ( $rss_items as $item ) :
echo ‘
endforeach;
echo “
endif;
endif;
?>[/php]
I get the feed I want but I would want to add an extra funcionality - namely I wanted to add rel=“lightbox” to all the images that are extracted so people can click on them to view them enlarged - some are a little small by default.
Anyone can show me how to tweak this php code in order to achieve this?
Thanks!