adding pages to the loop and rss

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

adding pages to the loop and rss

Koen-2
I think that adding pages to the loop maybe is done
easiest by not using the loop but using a custom query
using the wpdb class. Or are there better solutions?

About having pages in the rss feed also, I'm a bit at
loss. Is there any other option besides altering the
different feed.php pages. It would be a lot nicer if I
could do this through a plugin.

Any suggestions appreciated.
Koen

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: adding pages to the loop and rss

Sam Angove
On 3/16/06, Koen <[hidden email]> 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);
        }
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: adding pages to the loop and rss

Koen-2
That does indeed work for both problems. Tnx. My
mistake was that I thought there needed to be
query_vars in the wp_query.

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


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers