日期:2014-09-22 阅读:2246
dmandwp系统 - wordpress系统和DM系统区块建站>>
db_query:
$node_limit = variable_get('recent_posts_block_count', 3);
$content_type = 'blog';
$query = db_query('SELECT n.nid FROM {node} n WHERE n.type = :type AND n.status = 1 ORDER BY n.created DESC LIMIT 0, ' . $node_limit, array(':type' => $content_type));
$nids = $query->fetchCol(); //这是取得多个node的id
$nodes = node_load_multiple($nids); //把上面取的id生成对象
-----------------------