Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.2.1, error, javascript, WP_Query
- This topic has 17 replies, 3 voices, and was last updated 11 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
03/13/2015 at 1:28 pm #322723
Steven Zahm
Keymaster@ boerup
Well… the theme seems to be fairly well written which is great. Trust me I run into some that I personally would not use.
That said, there is a bug. In many of the theme’s template pages they are doing this:
$wp_query = null;Very, very, bad… you never mess with global variable
$wp_query, things will break in very unexpected ways.I commented out (removed) those and theme and Connections work together now. But I think there is still another bug with theme. I’ll try to explain.
They are nullin’ing out that global variable because they are resetting it to run a new query. First, you do not need to do that, second, they are 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.phpfile. They are doing this:<?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.
Hope that helps!
03/13/2015 at 1:31 pm #322725Steven Zahm
Keymaster@ boerup
Oh, should add…
The reason it appeared to be a javascript conflict is because of what I explained above cause the page to stop rendering so all the scripts where not being loaded … actually everything afterward was not being loaded, the entire page foot.
03/17/2015 at 6:26 pm #323291Anders
ParticipantThank you, thank you, thank you!
Let me just point out that this has been the best support I have ever experienced.
/B
03/17/2015 at 6:49 pm #323293Steven Zahm
KeymasterThanks!
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
03/25/2015 at 7:46 am #324460Anders
ParticipantThis reply has been marked as private.03/25/2015 at 9:00 am #324463Steven Zahm
Keymaster@ boerup
It’s in the
footer frontpage.phpfile. The exact issue/code and what I did to correct it is in this reply.I did find it in other files as well, but I can not remember which ones and I’m pretty sure I did not change those because there were not causing a direct conflict. My guess is because you were not actually using those theme files anywhere on your site.
Hope that helps!
03/25/2015 at 9:08 am #324464Anders
ParticipantThis reply has been marked as private.03/25/2015 at 10:53 am #324468Steven Zahm
Keymaster@
<!– –>is an HTML comment which does not comment out PHP code. You have to use either//before the actual PHP code which starts after the<?phptag. Or use/* */which must wrap the PHP code just like a HTML comment. This must wrap the actual PHP code which means after<?phpand before?>.Hope that helps!
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
