Single page theme

WordPress queries are indeed represented by WP_Query objects. The snippet example you have is secondary query, as opposed to main query – which is run by WP itself during core load and stored in global $wp_query variable.

Typically it is better (for performance and compatibility) to modify main query for set of posts that is main to page – see pre_get_posts hook documentation.

When you are running query loop, what happens is that WP fills number of global variables (main being $post) with data for current post. Functions that access those variables and output information (such as the_title()) are called template Tags and Codex has list of them that should get you started.

Leave a Comment