当我这样做的时候
$gallerypage = new WP_Query(array(
\'post_type\' => \'post\',
\'pagename\' => \'gallery\'
));
$gallerypage->the_post();
最后一行
$gallerypage->the_post();
给了我错误。为什么会这样?这似乎是正确的?
Notice: Undefined offset: 0 in /site/url/wp-includes/query.php on line 2719
Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3491
Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3493
Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3495
Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3496
Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3503
Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3514
Notice: Trying to get property of non-object in /site/url/wp-includes/post-template.php on line 30
Notice: Trying to get property of non-object in /site/url/wp-includes/post-template.php on line 30
wp包括/查询。php第2717行之后
$this->current_post++;
$this->post = $this->posts[$this->current_post]; // error here?