Title: conflict with shortcode query
Last modified: August 21, 2016

---

# conflict with shortcode query

 *  [stevieg](https://wordpress.org/support/users/stevieg/)
 * (@stevieg)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-shortcode-query/)
 * I’ve just updates to 2.0.33 and nextgen has stopped working (just shows the shortcode).
   I have tracked the problem to a conflict with a shortcode I have in the functions.
   php file which display posts at the end of a page.I can get nextgen functioning
   again by deleting the the_content(); line from the following code
 *     ```
       /**
        * Add a QUotes Shortcode
        * allows selection of quotes by tag
        */
       function im_quotes($atts, $content = null) {
               extract(shortcode_atts(array(
                       "num" => '5',
       				"tag" => ''
               ), $atts));
               global $post;
   
       		$tmp_post = $post;
       		$quotes_args = array(
       			'orderby' => 'rand',
       			'order' => 'DESC',
       			'posts_per_page' => $num,
       			'no_found_rows' => true,
       			'post_status' => 'publish',
       			'post__not_in' => get_option( 'sticky_posts' ),
       			'tag' => $tag,
       			'tax_query' => array(
       				array(
       					'taxonomy' => 'post_format',
       					'terms' => array( 'post-format-quote' ),
       					'field' => 'slug',
       					'operator' => 'IN',
       				),
       			),
       		);
       		$quotes = get_posts( $quotes_args );
       		ob_start();
       		echo '<div class="quote-short">';
       		echo '
       <ul>';
       		foreach($quotes as $post) :
       	                setup_postdata($post);
       				echo '
       <li><div class="quote-text">';
       				the_content();
       				echo '</div><div class="quote-uthor">';
       				the_title();
       				echo '</div></li>
       ';
       	    endforeach;
       		echo '</ul>
       ';
       		echo '</div>';
       		$outx = ob_get_contents();;
       		$post = $tmp_post;
       		ob_end_clean();
               return $outx;
       }
       add_shortcode("imquote", "im_quotes");
       ```
   
 * I am struggleing to see why this would cause a problem now – any ideas?
 * [http://wordpress.org/plugins/nextgen-gallery/](http://wordpress.org/plugins/nextgen-gallery/)
 * **_Please be sure to use the code buttons when posting code –
    [http://codex.wordpress.org/Forum\_Welcome#Posting\_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
   _

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-shortcode-query/#post-4248514)
 * [@stevieg](https://wordpress.org/support/users/stevieg/) – You may have an issue
   with how you code is handling recursive shortcode cals. There is some information
   on how you might address that on the Shortcodes API page here: [http://codex.wordpress.org/Shortcode_API](http://codex.wordpress.org/Shortcode_API)
 * Just scan down to the section with this reference:
 * > [caption]Caption: [myshortcode][/caption]
 *  as a starting point.
 * – Cais.
 *  Thread Starter [stevieg](https://wordpress.org/support/users/stevieg/)
 * (@stevieg)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-shortcode-query/#post-4248780)
 * This has only become a problem with the latest version of Nextgen installed. 
   1.9.13 is fine. I’m following the conventions layed out in the codex. I’m not
   using the shortcode recursively. The Page simply has a [imquote tag=”east-view-
   barn”] to display posts with this tag.
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-shortcode-query/#post-4248782)
 * [@stevieg](https://wordpress.org/support/users/stevieg/) – Does this happen if
   you have another shortcode (other than a NextGEN shortcode) in the post content
   as well?
 * If not, then feel free to submit a Bug Report ([http://www.nextgen-gallery.com/report-bug/](http://www.nextgen-gallery.com/report-bug/)…
   please reference this topic) so we can have a closer look at what might be causing
   this to happen.
 * Thanks!
 * – Cais.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘conflict with shortcode query’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [photocrati](https://wordpress.org/support/users/photocrati/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/conflict-with-shortcode-query/#post-4248782)
 * Status: not resolved