[wp-hackers] get_posts and custom post types

Adriaan Pelzer adriaan at wewillraakyou.com
Mon Aug 16 17:12:17 UTC 2010


I've built many sites with severely customized templates where I used
get_posts to retrieve pages. No problem yet. Just remember to set
"numberposts=-1" if you want all the pages, but this holds for posts too.

Adriaan Pelzer
RAAK Ltd
http://www.wewillraakyou.com
+4478 7978 1743



On Mon, Aug 16, 2010 at 5:28 PM, Curtis McHale <curtis at curtismchale.ca>wrote:

> I haven't had any trouble in any of the 3 projects I'm currently working on
> dealing with custom post types (nor the two already live).
>
>
> scribu wrote:
>
>> On Mon, Aug 16, 2010 at 5:59 PM, Simon Blackbourn<piemanek at gmail.com
>> >wrote:
>>
>>  I'm currently using get_posts on several sites to retrieve custom post
>>> types.
>>>
>>> But I've just noticed that in the parameters section of the Codex page
>>> for
>>> get_posts [1], a big bunch of text has been struck through and replaced
>>> with
>>> this new message:
>>>
>>> *get_posts() only works with posts of the post_type "post". It will
>>> produce
>>> unexpected results when used to retrieve custom post types or pages.*
>>>
>>> I have not personally noticed any problems, so can anyone expand on what
>>> issues may arise?
>>>
>>>
>> When noticing things like this, you should look at who made the change. My
>> guess is it was an unexperienced user who had trouble:
>>
>>
>> http://codex.wordpress.org/index.php?title=Template_Tags%2Fget_posts&diff=91997&oldid=86154
>>
>>
>>
> --
> Curtis McHale
>
> 604.751.3482
> http://curtismchale.ca
> http://twitter.com/curtismchale
> http://ca.linkedin.com/in/curtismchale
>
>
> _______________________________________________
> 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