[wp-hackers] WP_Query and multiple pages
photofantaisie at gmail.com
Mon Aug 3 20:05:53 UTC 2009
Thanks for the suggestion. Yes, I have the Page ID's available, and I
already thought of using get_post_custom. I think I'll dig a little deeper
into this and see if this will work for me. Apart from the post title, which
I can get with get_the_title(), I only need custom field data for these
Pages, therefore avoiding the overhead of a post object would be ideal.
2009/8/3 Will Anderson <wp-hackers at itsananderson.com>
> If you've already got a list of page ID's for which you'd like to get the
> > post meta, why not just loop through the ID's and call get_post_custom on
> > them. It will return a key/value associative array of the meta fields.
> > should also have a lot less overhead than generating a post object for
> > page.
> I forgot to mention, the array that's returned is a little funky because
> there can be multiple custom field values. Check out the Codex page for
> It's basically going to be of the form:
> 'key1' => Array(
> 0 => 'value1',
> 1 => 'value2'
> 'key2' => Array(
> 0 => 'value1'
> Will Anderson
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers