Before for the long explanation… the simple fix is to update the CherryFramework as this bug was fixed back on Dec 17, 2014. You can see the fix here:
https://github.com/CherryFramework/CherryFramework/commit/576b46f146d1f3820a74c65003e7afe7ac6ee942
Themes based on the CherryFramework will give the following error message when Connections is installed and the FAQ page template is used:
Fatal error: Call to a member function get() on a non-object in /../wp-includes/query.php on line XX
The theme’s FAQ page template page has this following code:
$wp_query = null; |
Very, very, bad.. the global variable $wp_query should never be altered, things will break in very unexpected ways.
Those lines can be commented out (removed) and theme and Connections work together. However there still may be another bug with theme. I’ll try to explain.
The theme is nullin’ing out that global variable because they are resetting it to run a new query. First, does not need to be, second, the theme is overwriting it which should not be done because that original copy is gone and cannot be restored if needed.
Here’s an example from a CherryFramework based theme:
//query $temp = $wp_query; $wp_query = null; $args = array( 'post_type' => 'faq', 'showposts' => -1, 'suppress_filters' => $suppress_filters ); $wp_query = new WP_Query($args); if (have_posts()) : ?> <dl class="faq-list"> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <dt class="faq-list_h"> <h4 class="marker"><?php echo theme_locals("q"); ?></h4> <h4><?php the_title(); ?></h4> </dt> <dd id="post-<?php the_ID(); ?>" class="faq-list_body"> <h4 class="marker"><?php echo theme_locals("a"); ?></h4> <?php the_content(); ?> </dd> <?php endwhile; ?> </dl> <?php else: ?> <div class="no-results"> <?php echo '<p><strong>' . theme_locals("there_has") . '</strong></p>'; ?> <p><?php echo theme_locals("we_apologize"); ?> <a href="<?php echo home_url(); ?>/" title="<?php bloginfo('description'); ?>"><?php echo theme_locals("return_to"); ?></a> <?php echo theme_locals("search_form"); ?></p> <?php get_search_form(); /* outputs the default Wordpress search form */ ?> </div><!--no-results--> <?php endif; $wp_query = null; $wp_query = $temp; |
It should be done like this:
//query // $temp = $wp_query; // $wp_query = null; $args = array( 'post_type' => 'faq', 'showposts' => -1, 'suppress_filters' => $suppress_filters ); $new_query = new WP_Query($args); if (have_posts()) : ?> <dl class="faq-list"> <?php while ($new_query->have_posts()) : $new_query->the_post(); ?> <dt class="faq-list_h"> <h4 class="marker"><?php echo theme_locals("q"); ?></h4> <h4><?php the_title(); ?></h4> </dt> <dd id="post-<?php the_ID(); ?>" class="faq-list_body"> <h4 class="marker"><?php echo theme_locals("a"); ?></h4> <?php the_content(); ?> </dd> <?php endwhile; ?> </dl> <?php else: ?> <div class="no-results"> <?php echo '<p><strong>' . theme_locals("there_has") . '</strong></p>'; ?> <p><?php echo theme_locals("we_apologize"); ?> <a href="<?php echo home_url(); ?>/" title="<?php bloginfo('description'); ?>"><?php echo theme_locals("return_to"); ?></a> <?php echo theme_locals("search_form"); ?></p> <?php get_search_form(); /* outputs the default Wordpress search form */ ?> </div><!--no-results--> <?php endif; wp_reset_postdata(); // $wp_query = null; // $wp_query = $temp; |
Just like it is shown in the WordPress Codex.