Problem with different query loops (and "main loop") on category template page!
so, heres the problem:
i've created a category-template (category.php) with two query loops and the main loop (in which the content from the category should get looped in). if i now click on a category the template page shows but also the first two query loops get affected by it. everything is messed up.
above is my template architecture. as you can see, i used the wp_reset_query function but this did not help. how do i make JUST THE MAIN LOOP react to the catgeory posts?
the first loop:
div id="slider1"
?php $args = array( 'post_type' = 'slider');
$loop = new WP_Query( $args );
while ( $loop-have_posts() ) : $loop-the_post();?
div class="startslide" style="background-color: ?php echo get_post_meta($post-ID, 'Farbcode', true); ?"
div class="slideimg"?php the_post_thumbnail( 'slider' ); ?/div
h1?php the_title(); ?/h1
div class="subline"?php the_content(); ?/div
/div
?php endwhile; ?
?php wp_reset_query(); ?
/div !--! end of #slider1 --
the second loop:
div id="topteaser"
?php $args = array( 'post_type' = 'teaser');
$loop = new WP_Query( $args );
while ( $loop-have_posts() ) : $loop-the_post();?
div class="topteaseritem" style="background:url(?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post-ID), array( 36,36 ), false, '' ); echo $src[0]; ?) no-repeat 10px top"
h3?php the_title(); ?/h3
?php the_content(); ?
/div
?php endwhile; ?
?php wp_reset_query(); ?
/div
..and the third loop (the main loop):
div id="slider2"
?php if (have_posts()) : ?
?php while (have_posts()) : the_post(); ?
div class="post"
div class="postimg"a href="?php the_permalink() ?"?php the_post_thumbnail( 'related' ); ? /a/div
div class="postcontent"
h3?php the_title(); ?/h3
?php the_content(); ?
/div
/div
?php endwhile; ?
?php endif; ?
/div !--! end of #slider2 --
i hope you get my problem as i'm not a native english speaker (it's hard to explain all that) ;-)
Topic wp-reset-query loop page-template categories query-posts Wordpress
Category Web