Since WordPress doesn't support rss feeds for pages out of the box and I needed it, I decided to write this plugin to satisfy my need for now. Like the title says, this is quick and dirty, but it gets the job done. The next version of this plugin will be an RSS 2 feed. I just wanted to get this out since I saw a lot of people asking about this in the WP forums.
Download [download#11#size#nohits]
$pid,'sort_order'=>'DESC'));
} else {
$pages = get_pages(array('sort_order'=>'DESC'));
}
echo ''; ?>
http://backend.userland.com/rss092
-
=$page->post_title?>
post_content?>]]>
ID); ?>
To use it, place the file in your plugins folder and then call your feed like this:
[html]
This will call all of your pages (the limit is set by the default post per page limit in WP)
http://example.com/?feed=page
This will call only children of the page with an id of 30.
http://example.com/?feed=page&pid=30
[/html]
I'll post back with an advanced version of this plugin once I get time to write it. Feel free to make feature requests here.
Comments (7)
Feb 24, 2009 at 10:53 PM
Anastasia Bodnar:
Thanks for this plugin. Like you, I just want something simple to view a feed in a page. Unfortunately, I'm not very experienced with writing/editing code. Can you please elaborate on how exactly to "call the feed"? I'm sorry for being such a noob. Thanks in advance!
Mar 26, 2009 at 07:45 PM
Dukessa:
Very nice plugin! I really needed this :) I was wondering if you could make it possible so that NextGen Galleries Images are shown as well in the feed (as I have a photography website, there's not much text really, mostly photos) I would like the feed to update for every time a gallery is added to a page or edited. The gallery tag that I use into pages is [nggalery id=x] where x is a number, depending on gallery id's. Hopefully you'll have some time to implement this, would be really great :) Thank you for your work!!
Apr 28, 2009 at 12:39 AM
Colin Holmes:
Works well and it has a lot of potential simply because the whole site can be effectively sent via RSS feeds. Tremendous function and has the potential to shift wordpress away from being fixed purely on blogging. I would desperately like to know how to organise the page order the way I want it. Can anybody help???
May 08, 2009 at 12:02 PM
Lars:
Hi, I try to get running your plugin under WPMU+Buddypress and get the following error message: Warning: Cannot modify header information - headers already sent by (output started at /kunden/164714_98574/sc-final/wp-content/plugins/page-rss-plugin.php:2) in /kunden/164714_98574/sc-final/wp-includes/pluggable.php on line 856
May 10, 2009 at 04:07 PM
Josh:
The following code will add support for post slugs using a "pname" variable in the URL. global $wpdb; //add at top of function //replace line 17 with the folllowing $pname= $_GET['pname']; if(is_string($pname) && !empty($pname)) { $sql = $wpdb->prepare("select ID from {$wpdb->posts} where post_name = %s", $pname); $pid = $wpdb->get_var($sql); } else { $pid = $_GET['pid']; } Combine this plugin with some strategic use of mod_rewrite, and you can make pretty URLs for your page feeds too. For example, the following rewrite rule will replace the default comment feed with your page feed (seems logical if pages don't have comments turned on): RewriteRule ^([^/\.]+)/feed/?$ /index.php?feed=page&pname=$1 This first URL http://www.example.com/blog/your-page/feed/ will get rewritten to the following URL supported by the plugin: http://www.example.com/blog/index.php?feed=page&pname=your-page
Aug 31, 2009 at 06:37 AM
ckutay:
Can also use existing feed changing post_type ='post' to post_type='page' or 'any' in wp-includes/ query.php post.php widget.php
Jan 29, 2010 at 06:14 AM
Sara @ Womens Halloween Costume:
Your a life saver, thanks very much this is exactly what i have been looking for, the built in feeds on alot of the blogs have, have been giving me a lot of problems. Thanks again