Title: [Plugin: Multiple Content Blocks] Not working after custom query loop
Last modified: August 30, 2016

---

# [Plugin: Multiple Content Blocks] Not working after custom query loop

 *  [rolzan](https://wordpress.org/support/users/rolzan/)
 * (@rolzan)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-not-working-after-custom-query-loop-1/)
 * I’ve ran into some problems using this plugin. On the first sections of my page
   template, the content blocks are working, until I tried adding a new one **after**
   a section where I have a custom query loop.
 * Like this:
 *     ```
       <section1>
           <?php the_block('front-s1-heading', array('label'=>'Section 1 - Big Red Text', 'type' => 'one-liner' )); // Working ?>
       </section1>
   
       <section2>
           <?php
       			// Define custom query parameters
       			$custom_query_args = array(
       				'posts_per_page' => '1',
       				'post_type' => 'testimonial',
       				'post_status' => 'publish',
       				'order' => 'ASC'
       			);
   
       			// Get current page and append to custom query parameters array
       			$custom_query_args['paged'] = get_query_var( 'page' ) ? get_query_var( 'page' ) : 1;
   
       			// Instantiate custom query
       			$custom_query = new WP_Query( $custom_query_args );
   
       			// Pagination fix
       			$temp_query = $wp_query;
       			$wp_query   = NULL;
       			$wp_query   = $custom_query;
   
       			if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
   
       				<div id="testimonial-<?php the_ID(); ?>" class="testimonial-item center-block">
       					<hr>
       					<div class="row">
       						<div class="testimonial-em col-md-6">
       							<h3 class="testimonial-title"><?php the_field('big_text'); ?></h3>
       						</div>
       						<div class="testimonial-rg col-md-6">
       							<?php the_content(); ?>
       							<p>- <?php the_title(); ?></p>
       						</div>
       					</div>
       				</div>
   
       			<?php endwhile; ?>
   
       				<?php //the_posts_navigation(); ?>
   
       			<?php endif;
       			wp_reset_postdata();
   
       			// Reset main query object
       			$wp_query = NULL;
       			$wp_query = $temp_query;
       		?>
       </section2>
   
       <section3>
           <?php the_block('front-s3-heading', array('label'=>'Section 3 - Big Red Text', 'type' => 'one-liner' )); // NOT Working ?>
       </section3>
       ```
   
 * I tried removing the section with the custom loop and the blocks are showing.
 * P.S. I’m using another plugin (Advanced Custom Fields), and tried removing this
   code `<?php the_field('big_text'); ?>` but it’s still not working.

The topic ‘[Plugin: Multiple Content Blocks] Not working after custom query loop’
is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [rolzan](https://wordpress.org/support/users/rolzan/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/plugin-multiple-content-blocks-not-working-after-custom-query-loop-1/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
