RSS aggregation outside of the loop in the footer?
I don’t know if this is possible, but I want to aggregate the blog titles into my footer. Meaning, in the footer.php I want to have something like the 5 latest titles showing.
From the reading I’ve done, this is outside the loop, meaning I’m not putting the code directly into the posts or pages section. Is there another way to have the footer gather this information without me having to use strictly php? I have very little php experience and don’t even know where to begin writing code to make this happen. Besides, there are so many great plugins but I am not sure how to integrate them into the templates so that they actually work.
For instance, I’m trying to the plug-in called Aggregate and when I enter the code < –rss url=”http://news.google.com/?output=rss”– > (without spaces and including the !) into my footer.php file, I see nothing. Does anyone have any ideas for me? Thanks!
There are plugins available that will display recent posts, and I know at least one could be configured to display just the title if you wish. Although most folks would put this in the sidebar, there’s no reason you couldn’t have it in your footer.
To look for a suitable plugin, start here > http://codex.wordpress.org/User:Matt/2.0_Plugin_Compatibility
Thanks for the reply, manstraw, but I already found what I think is a suitable plugin. I just wish I knew how to successfully get the code to work in the footer.php file, or find a better way of doing this. Besides looking for a new plug-in and making me find out the answer, do you have any suggestions?
Double check your installation process, and confirm with the author that the version of the plugin you are using is compatible with the version of wordpress you are using.
(Plugin author checking in)
I don’t think fetching RSS is really the right way to go about it, if you’re doing what I think you’re doing. Essentially, here is what would happen:
1. You create a new HTTP request to the feed URL.
2. WordPress fetches the posts from the database
3. WordPress generates the RSS for the given posts.
4. The script downloads the RSS.
5. The script parses the RSS.
6. The script displays the items.
If you just fetched the posts directly from the database—as the various “recent posts” plugins do—then you’d eliminate steps one, three, four, five and six, making things considerably faster and easier.
I think you can do something like this:
<?php _e('Latest Posts'); ?>
<?php query_posts('showposts=5'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<linkage="<?php the_permalink() ?>"><?php the_title() ?> </linkage>
<?php endwhile; endif; ?>
replace “linkage” with anchor tags.
- The topic ‘RSS aggregation outside of the loop in the footer?’ is closed to new replies.