[wp-hackers] query_posts behaviour

Jon Mihkkal Inga lilla.molnet at gmail.com
Tue Jan 27 16:05:41 GMT 2009


Dude, that did work.Thank you very much. :)

/j.

2009/1/27 Austin Matzko <if.website at gmail.com>

> On Tue, Jan 27, 2009 at 9:53 AM, Jon Mihkkal Inga
> <lilla.molnet at gmail.com> wrote:
> > I've noticed something about the the query_posts function. It doesn't do
> > anything if I set 'post_type' to 'attachment'. I would expect it to setup
> > all attachments so that they are available in the loop. Is this the
> intended
> > behaviour?
>
> You need to also specify "post_status" as "inherit".  That's because
> by default "post_status" is "publish," which does not apply to
> attachments.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list