Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

We can filter our posts with a URL query string: http://mysite.com/?cat=5

We can also use a similar syntax for get_posts('cat=5') and new WP_Query('cat=5').** get_posts('param=value'); just passes the string to new WP_Query('param=value');, so it follows that these work the same.

While these all seem to have the same syntax, the URL query string supports different parameters.

  • I don't see subpost or subpost_id documented anywhere in the WP_Query class, yet it seems to do something with the URL (although I can't figure out exactly what)
  • category__in doesn't work with the URL query string.

After much searching, I finally found this site that lists the supported URL query string variables, but not sure what all of them do.

Where is the documentation for these URL query string variables?

WP_Query supports many more parameters that don't seem to be supported in the URL query. Why doesn't the URL query string just get passed directly to WP_Query?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Take look at official Query vars. You will see two columns and by then you will get why category__in doesn't work with the URL query string. (basically, the private keywords works only if you specify them in wp_query or so...)

About subpost, I am not a hundred percent sure, what it is. In the whole WP_Query it is mentioned only with attachments, take a look.

share|improve this answer
    
ty, never seen that page :/ –  Mike Lewis Nov 13 '13 at 20:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.