[wp-hackers] pre_get_posts problem

Krusty Ruffle krustyruffle at rustykruffle.com
Wed Aug 11 08:08:25 UTC 2010


> > This causes me to get a page with nothing but the $query on most pages
> > however, It does nothing on the blog index.
>
> You've got something else going on in your system with other plugins or
> something. You'll have to track that does first.  Try disabling other
> plugins.
>
> > The main blog index still loads a page with only the built in post types
> on it.
> > This leads me to believe that the 'parse_query' action is not being
> called there.
>
> It sounds like it is being called but $query contains nothing it seems.
>  Try this to see if "We're Here" shows up.
>

If this were the case wouldn't the die() cause it to print a blank page and
not a normal page of posts?


>
> add_filter( 'parse_query', 'my_parse_query' );
> function my_parse_query( $query ) {
>      echo "We're Here!";
>     print_r( $query ); die();
> }
>

After disabling all plugins, including the one for the post type actually,
then switching to the Twenty Ten theme and placing the code in the
functions.php file this still did nothing on the main index.

After doing a bunch of looking around through WordPress files it seems that
'parse_query' filter is indeed not called on the index page. I think I may
have figured out how I can use the 'request' filter though... I'll send an
email to the list tomorow to see if anyone can verify that it's right or
wrong or what kind of issues it may have.

Thanks again for your help!


More information about the wp-hackers mailing list