function &query_posts($query) {}

Set up The Loop with query parameters.
This will override the current WordPress Loop and shouldn’t be used more than once. This must not be used within the WordPress Loop.


  • string $query

Return values

returns:List of posts

Source code

function &query_posts($query) {


	$GLOBALS['wp_query'] = new WP_Query();

	return $GLOBALS['wp_query']->query($query);



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: