Using WordPress public query variables

In simple words – it will tell wordpress what to query (to request a data from database).

in all of cases it will try to search a posts (no mater post this or page or other post type)

http://dmkim.ru/?s=uuu – eq search uuu on posts (default post type post & pages) and return a results (this is search)

http://dmkim.ru/?year=2013 – eq to archive for 2013 year (for default post types)


this is a dirty style (non URL/SEO friendly), usually people enable url friendly mode so wp generate a internal rewite rules which transform urls like

http://dmkim.ru/search/uuu
http://dmkim.ru/archive/2013

into dirty style get variables that can be easily transformed to wp_query (and generated SQL query to get posts) for your template.

Leave a Comment