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?
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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘conflict with shortcode query’ is closed to new replies.