Many of the theme’s template pages they are doing this:
$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 the footer frontpage.php file:
<?php $wp_query = null; ?> <?php $wp_query = new WP_Query( $args ); ?> <?php if ( $wp_query->have_posts() ) : ?> <div class="status-title"> <h1><?php _e('Status:', 'wplook'); ?></h1> </div> <div id="slider-status" class="flexslider"> <ul class="slides"> <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php the_title() ?> - <?php wplook_get_date(); ?></a></li> <?php endwhile; wp_reset_postdata(); ?> </ul> </div> <div class="clear"></div> <?php endif; ?> |
It should be done like this:
<?php $new_query = new WP_Query( $args ); ?> <?php if ( $new_query->have_posts() ) : ?> <div class="status-title"> <h1><?php _e('Status:', 'wplook'); ?></h1> </div> <div id="slider-status" class="flexslider"> <ul class="slides"> <?php while ( $new_query->have_posts() ) : $new_query->the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php the_title() ?> - <?php wplook_get_date(); ?></a></li> <?php endwhile; wp_reset_postdata(); ?> </ul> </div> <div class="clear"></div> <?php endif; ?> |
Just like it is shown in the WordPress Codex.
NOTE: This FAQ was written based on StereoClub 1.0.4.