[wp-hackers] Including custom post types on archive pages
frank at bueltge.de
Thu Jun 9 19:00:18 UTC 2011
@Nacin: yes, you have right; i will change on gist this.
On Thu, Jun 9, 2011 at 7:23 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
> On Thu, Jun 9, 2011 at 7:54 AM, Frank Bueltge <frank at bueltge.de> wrote:
> > See this gist for a example: https://gist.github.com/998648
> > Best regards
> > Frank
> Not really.
> pre_get_posts isn't a filter, it's an action where the query is passed by
> reference. So there's no return value, and it's add_action rather than
> Don't check for suppress_filters. You're doing that to make sure this isn't
> a get_posts() call, rather than properly checking if this is the main
> The is_admin() and is_preview() checks are superfluous, given the is_home()
> and is_front_page() checks.
> So, a few options: Use the parse_request or request filters, which only
> on the main query. Or use $wp_the_query to confirm you're acting on the
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers