Title: [Plugin: Events Manager] crashes \includes\query.php get non object
Last modified: August 20, 2016

---

# [Plugin: Events Manager] crashes \includes\query.php get non object

 *  [bgwriter09](https://wordpress.org/support/users/bgwriter09/)
 * (@bgwriter09)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/)
 * Hi. After installing 5.1.4 of Events Manager, received the following error:
    **
   Call to a member function get() on a non-object in [website]/wp-includes/query.
   php on line 27** Could not access dashboard, website, etc. Had to rename \content\
   plugins\events-manager to restore WP GUI. Tried reactivating but error returned,
   so am replacing with another plugin. Hopefully issues with events manager will
   be resolved. I enjoyed it when it worked.

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/page/2/?output_format=md)

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2645883)
 * Can I get more info. on your wp installation? e.g. theme, plugins, buddypress
   or multisite?
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646152)
 * Hi,
 * I have the same problem. If I activate the Event Manager plugin, the templates
   of my site which I print entries of one category not run and WordPress print “\
   includes\query.php get non object”.
 * The code of my templates is:
 *     ```
       <?php
       if (is_page() ) {
       	$category = 'Noticias CJE';
       }
       if ($category) {
       	$cat = get_cat_ID($category);
       	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       	$post_per_page = 2; // -1 shows all posts
       	$do_not_show_stickies = 1; // 0 to show stickies
       	$args=array(
       		'cat' => $cat,
       		'paged' => $paged,
       		'showposts' => $post_per_page
       	);
       	$temp = $wp_query;  // assign orginal query to temp variable for later use
       	$wp_query = null;
       	$wp_query = new WP_Query($args);
       	if( have_posts() ){
   
       		while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
       			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
       				<strong><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></strong>
       				<div class="entry">
       					<?php the_content('Read the rest of this entry »'); ?>
       				</div>
       			</div>
       <?php
       		endwhile;
   
       		if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
       	}else{
       ?>
       		<h2 class="center">No encontradas noticias</h2>
       <?php
       	}
       	$wp_query = $temp;  //reset back to original query
   
       }  // if ($category)
       ```
   
 *  [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646158)
 * have any of you tried this with the default theme enabled?
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646160)
 * No, I use twentyeleven theme.
 * I use this Page Template to print in this page all entries of one category.
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646173)
 * After installing 5.1.4.1 version, the problem continue.
 *  [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646179)
 * do you have a sample url? it definitely works with 2011 as that’s what we test
   on
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646188)
 * Sorry, I’m new in WordPress.
 * What it is 2011?
 * I haven’t a sample url because is in production server, sorry.
 * I’ve updated 5.1.4.3 version and the problem continue.
 * WP version 3.3.1, no multisite.
 * I post all my template.:
 *     ```
       <?php
       /*
       Template Name: PageOfCJENews
       */
       get_header('comun'); ?>
   
       		<div id="primary">
       			<div id="content" role="main">
   
       <?php
       if (is_page() ) {
       	$category = 'Noticias CJE';
       }
       if ($category) {
       	$cat = get_cat_ID($category);
       	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       	$post_per_page = 2; // -1 shows all posts
       	$do_not_show_stickies = 1; // 0 to show stickies
       	$args=array(
       		'cat' => $cat,
       		'paged' => $paged,
       		'showposts' => $post_per_page
       	);
       	$temp = $wp_query;  // assign orginal query to temp variable for later use
       	$wp_query = null;
       	$wp_query = new WP_Query($args);
       	if( have_posts() ){
   
       		while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
       			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
       				<strong><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></strong>
       				<div class="entry">
       					<?php the_content('Read the rest of this entry »'); ?>
       				</div>
       			</div>
       <?php
       		endwhile;
   
       		if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
       	}else{
       ?>
       		<h2 class="center">No encontradas noticias</h2>
       <?php
       	}
       	$wp_query = $temp;  //reset back to original query
   
       }  // if ($category)
       ?>
   
       			</div><!-- #content -->
       			<?php get_sidebar(); ?>
       		</div><!-- #primary -->
       <?php get_footer(); ?>
       ```
   
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646189)
 * I tried your code and seems that the problem is at lines:
 *     ```
       $args = array(
       		'cat' => $cat,
       		'paged' => $paged,
       		'showposts' => $post_per_page
       	);
       ```
   
 *  or maybe in your WP_Query
 *  [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646190)
 * Your problem is that you’re assuming EM CPTs have post category taxonomies, which
   it doesn’t
 * check this out [http://wp-events-plugin.com/blog/2012/01/05/catchable-fatal-error-fix-when-upgrading/](http://wp-events-plugin.com/blog/2012/01/05/catchable-fatal-error-fix-when-upgrading/)
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646194)
 * Hi Marcus,
 * this page template isn’t for events or locations, it’s for another entries in
   my wordpress, but if I activate Event Manager plugin, the template doesnt work
   and print the message **Call to a member function get() on a non-object in [website]/
   wp-includes/query.php on line 27**. If I deactivate the Event Manager plugin,
   the template run and print my entries of Noticias CJE category.
 * Thanks **agelonwl**, I’m going to check again.
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646195)
 * Hi,
 * the problem is in $wp_query = new WP_Query($args);
 * I’ve tried `new WP_Query( 'cat=4' );` and problem persist.
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646201)
 * I tried it several times and made it work; try to rename `$wp_query` to something
   else e.g. `$wp_query1`
 * my version:
 *     ```
       <?php
       /*
       Template Name: PageOfCJENews
       */
       get_header('comun'); ?>
   
       		<div id="primary">
       			<div id="content" role="main">
   
       <?php
       if (is_page() ) {
       	$category = 'Noticias CJE';
       }
       if ($category) {
       	$cat = get_cat_ID($category);
       	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       	$post_per_page = 2; // -1 shows all posts
       	$do_not_show_stickies = 1; // 0 to show stickies
       	$args=array(
       		'cat' => $cat,
       		'paged' => $paged,
       		'showposts' => $post_per_page
       	);
       	$temp = $wp_query;  // assign orginal query to temp variable for later use
       	$wp_query1 = null;
       	$wp_query1 = new WP_Query($args);
       	if( have_posts() ){
   
       		while ($wp_query1->have_posts()) : $wp_query1->the_post(); ?>
       			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
       				<strong><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></strong>
       				<div class="entry">
       					<?php the_content('Read the rest of this entry »'); ?>
       				</div>
       			</div>
       <?php
       		endwhile;
   
       		if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
       	}else{
       ?>
       		<h2 class="center">No encontradas noticias</h2>
       <?php
       	}
       	$wp_query = $temp;  //reset back to original query
   
       }  // if ($category)
       ?>
   
       			</div><!-- #content -->
       			<?php get_sidebar(); ?>
       		</div><!-- #primary -->
       <?php get_footer(); ?>
       ```
   
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646214)
 * Hi agelonwl,
 * I tried it and the problem persists. The strange thing with the previous version
   of Eventa Manager did not happen and it worked OK.
 * I will try to downgrade to reconfirms that goes with version 5.1.3 of the plugin.
 * It is very strange because if I do not activate the plugin everything works OK.
 * Thank you very much.
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646215)
 * that’s strange, because it works fine on my test site with the same code. Do 
   you have a sample link?
 *  [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * (@jaolivan)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/#post-2646216)
 * No, sorry is in production

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/page/2/?output_format=md)

The topic ‘[Plugin: Events Manager] crashes \includes\query.php get non object’ 
is closed to new replies.

 * 22 replies
 * 4 participants
 * Last reply from: [jaolivan](https://wordpress.org/support/users/jaolivan/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-events-manager-crashes-includesqueryphp-get-non-object/page/2/#post-2646233)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
