Shortcode breaks Plugin
-
Hi there,
the Plugin works great an all my pages, except for the pages where I added a simple function via shortcode. The widgets just don’t show up. If I change the shortcode (“_get_special_posts”) the Widgets do appear.
The shortcode is this:
[get_special_posts cat=1 anz=3]
and in functions.php I have this:
function get_special_posts_function($atts) { $a = shortcode_atts( array( 'cat' => '1', 'anz' => 5 ), $atts ); query_posts('cat='.$a['cat'].'&showposts='.$a['anz']); echo $header; if (have_posts()) : while (have_posts()) : the_post(); $t = get_the_title(); echo "<h3>".$t."<h3>"; endwhile; endif; } add_shortcode( 'get_special_posts', 'get_special_posts_function' );
What is wrong here? How can I fix this?
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Shortcode breaks Plugin’ is closed to new replies.