我才意识到*empty WP_Query object* 在我的普通wordpress上安装。我重置了DB,停用了所有插件,并激活了TwentyTen作为主题,但每个请求(面向公共和管理)的完整对象都是空的。无论我是请求“Hello World”帖子还是404
. 一切都是空的。这有什么原因?
Edit 1<这是我检查的方式WP_Query:
// inserted on top of the functions.php file,
// so it\'s equal to a function hooked into the \'after_setup_theme\' hook
// i also tried other hooks (which should make no difference) and got the same result.
echo \'<pre>\';
print_r($GLOBALS[\'wp_query\']);
echo \'</pre>\';
这是
print_r();
WP_Query Object
(
[query] =>
[query_vars] => Array
(
)
[tax_query] =>
[queried_object] =>
[queried_object_id] =>
[request] =>
[posts] =>
[post_count] => 0
[current_post] => -1
[in_the_loop] =>
[post] =>
[comments] =>
[comment_count] => 0
[current_comment] => -1
[comment] =>
[found_posts] => 0
[max_num_pages] => 0
[max_num_comment_pages] => 0
[is_single] =>
[is_preview] =>
[is_page] =>
[is_archive] =>
[is_date] =>
[is_year] =>
[is_month] =>
[is_day] =>
[is_time] =>
[is_author] =>
[is_category] =>
[is_tag] =>
[is_tax] =>
[is_search] =>
[is_feed] =>
[is_comment_feed] =>
[is_trackback] =>
[is_home] =>
[is_404] =>
[is_comments_popup] =>
[is_paged] =>
[is_admin] =>
[is_attachment] =>
[is_singular] =>
[is_robots] =>
[is_posts_page] =>
[is_post_type_archive] =>
[parsed_tax_query] =>
)