Categories and showposts? Can somebody check my code?
-
Hey,
I’m trying to echo 2 categories and in max 5 posts. I got this code, but when i load the page, nothing appears. Could someone please go over it and tell me where the error is. I just can’t find it.
<?php get_header(); ?> <?php get_sidebar();?> <div id="content"> <div class="grid_8"> <div class="room"> <h2 class="h2">Aktuelle Diskussionsbeiträge</h2> <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query( array( 'category__and' => array( 429, 1335 ), 'showposts=5'.'&paged='.$paged)); ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <div class="grid_8"> <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Dauerhafter Link auf <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4> <?php the_excerpt(); ?> </div><?php endwhile; ?> <?php endif; ?> <div class="grid_8"> <?php if (function_exists('postbar')) postbar(); ?> </div> <div class="text grid_8"> <?php wp_reset_query(); if( have_posts() ) : while( have_posts() ) : the_post(); the_content(); endwhile; endif; ?> </div> </div></div> <div class="grid_4 kontakt"> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Seitenleiste Medienecho") ) : ?> <?php endif; ?> </div> </div><!-- close #content --> <div class="clear"></div> <?php get_footer(); ?>
Thank you very much in advance!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Categories and showposts? Can somebody check my code?’ is closed to new replies.