Beta test the next version of the Beaver Builder Theme!

Hey Ted,

No worries, thanks for asking. We’re finishing up some testing this week and plan to push the update out Sunday night. There will be an update for the builder as well. Stay tuned!

Justin

Just a heads up everyone, this just launched!

http://forum.wpbeaverbuilder.com/release-notes-wordpress-customizer-new-icons/

Let me know if you have any questions.

Thanks,
Justin

I am uncertain as to whether this is a bug in the beta version, whether it is in my coding or whether what I am doing is incompatible with Beaver Builder.

I have the beta version on a testing site - http://blnr.swwireframes.com/

On this site I have some code in functions php to allow php code in text widgets. I placed a text widget on the page using Beaver Builder and entered the following php code -

<?php
$args = array( 'post_type' => 'bird_image', 'orderby' => 'date', 'posts_per_page' => 6)
;
query_posts($args); 
$wp_query = new WP_Query( $args );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();

echo CFS()->get('display_the_bird');
endwhile;

wp_reset_postdata(); 
?>

The image from the cpt displays as expected on the page - http://blnr.swwireframes.com/beaver-test/. BUT the Beaver Builder has disappeared for this page and I cannot edit it.

I have two other pages ‘Home’ and New Home’. I have just placed an image and some text on these pages and they are working as expected.

So I imagine it is one of these four:

  1. Is there some issue with the beta version of the theme?
  2. is there some issue with Beaver Builder?
  3. Am I using Beaver Builder in an inappropriate manner?
  4. Is there an issue with the php coding provided above?

I am not sure.

Thanks,

John

Hey John,

Can you try wp_reset_query instead of wp_reset_postdata? Let me know how that goes.

Justin

That did the trick Justin. When you have a moment could you explain the issue. Has it been poor coding on my part? Should I always use wp_reset_query ?

Thanks,

John

Hey John,

Sure thing! The wp_reset_query function resets the global query data back to the main query. The wp_reset_postdata function only resets the global $post variable. In your case, you’re using query_posts which is overriding the main query that the builder is using. Anytime you override the main query, you should reset it after using wp_reset_query.

Justin

Thank you Justin. That makes sense.

Cheers,

John