A HitchHackers guide through WordPress


Home | Pages | Archives


query_posts

February 12, 2011 2:15 am

Definition:
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.

Parameters

Return values

returns:List of posts

Source code

function &query_posts($query) {

	unset($GLOBALS['wp_query']);

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

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

}

2633

Rate this:

Posted by Thorsten

Categories: /wp-includes/query.php, Documentation, Files, Functions, Functions by letter q

Tags: ,

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.