[wp-hackers] adding pages to the loop and rss

Sam Angove sam at rephrase.net
Thu Mar 16 10:01:23 GMT 2006


On 3/16/06, Koen <mephistopheles565 at yahoo.com> wrote:
>
> It would be a lot nicer if I could do this through a plugin.


A filter on the 'posts_where' hook should be able to do it -- just
strip out the "AND post_type = 'post'" condition.

This is untested, but something like:

	function show_pages_in_loop($where) {
		return str_replace("post_type = 'post' AND ", '', $where);
	}
	add_filter('posts_where', 'show_pages_in_loop');

I can't remember what version post_type was introduced in, but you
might need to chage post_status instead, with (e.g.):

	function show_pages_in_loop($where) {
	 	return str_replace(" AND post_status != 'static'", '', $where);
	}


More information about the wp-hackers mailing list