I’ve been looking for a good way to display the feed from the gallery since quite a while now. The built-in widget in wordpress is alright but doesn’t display images. Today I have tried SimplePie plugin for wordpress.
I use SimplePie on other projects and it has always served me well. The installation is simple, you need to download the SimplePie Core plugin and the SimplePie for wordpress plugin first. Upload both in your plugin folder and create a new folder called “cache” in your wp-content folder (will be useful later).
Now go to your admin panel->plugins and enable the two plugins.
That’s the installation done. Now we need to call the plugin from our template file. I take me example: in the sidebar. Open the sidebar.php file in your theme folder. Where you want your feed to be, paste the following code:
<?php
echo SimplePieWP(‘http://www.yoursiteisvalid.com/lastentries.rss’, array(
‘items’ => 3
));
?>
</li>
Replace of course the url here by the one you want to display. You can change the number of items displayed by changing the value of ‘items’. If your feed is like mine in the list “<ul>…</ul>” of widgets don’t forget the <li></li> around so you keep your code error free.
If you save this and open your website you should see the RSS displayed. Next step, tweaking the template file. Open the file default.tmpl in the template folder in the SimplePie plugin folder.
I have replaced the h3 tags by h2 to match the style of the other title in the sidebar. To display the images from the feed I have changed {TRUNCATE…} by {ITEM_CONTENT}
Here is my full template code:
{IF_ERROR_BEGIN}<p class="error">{ERROR_MESSAGE}</p>{IF_ERROR_END}
<h2>
<a href="{SUBSCRIBE_URL}">Gallery<img src="{PLUGIN_DIR}/images/feed.png" alt="feed" title="Subscribe to this feed!" /></a>
</h2>
<ul id="simpleRss">
{ITEM_LOOP_BEGIN}
<li>
<strong><a href="{ITEM_PERMALINK}">{TRUNCATE_ITEM_TITLE}</a></strong>
<br/>
{ITEM_CONTENT}
</li>
{ITEM_LOOP_END}
</ul>
</div>
Works fine so far, I like to see the little thumbnails from the gallery displayed here =).












Nice info, display rss feed are very useful on my blog I was try to install those plugins and running well, thanks