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 ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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