• 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?

    https://www.ads-software.com/plugins/nextgen-gallery/

    Please be sure to use the code buttons when posting code –
    https://codex.www.ads-software.com/Forum_Welcome#Posting_Code

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @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: https://codex.www.ads-software.com/Shortcode_API

    Just scan down to the section with this reference:

    [caption]Caption: [myshortcode][/caption]

    as a starting point.

    – Cais.

    Thread Starter stevieg

    (@stevieg)

    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

    (@photocrati)

    @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 (https://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.