Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




query_posts [ WordPress Function ]

query_posts ( $query )
Parameters:
  • (string) $query
Uses:
  • $wp_query
Returns:
  • (array) List of posts
Defined at:



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.

Source


<?php
function &query_posts($query) {
    unset(
$GLOBALS['wp_query']);
    
$GLOBALS['wp_query'] = new WP_Query();
    return 
$GLOBALS['wp_query']->query($query);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics