Add rel=lightbox to images extracted automatically from rss feeds
-
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 include_once(ABSPATH . WPINC . '/rss.php'); $feed = 'https://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 " <ul>\n"; foreach ( $rss_items as $item ) : echo ' <li>'; echo '<a>get_permalink() . '">' . $item->get_title() . "</a>\n"; echo '<p>' . $item->get_description() . "</li> \n"; endforeach; echo "</ul> \n"; endif; endif; ?>
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!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Add rel=lightbox to images extracted automatically from rss feeds’ is closed to new replies.