multiple loops and sidebar not working
-
Hi, I’m just getting my feet wet with php and am stuck on something. I’ve got a page with multiple loops using the <?php rewind_posts(); ?> and it seems to be working, but the sidebar isn’t working now. Is the rewind posts effecting it?
Here is the code for the page:
<?php get_header(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; ?> <?php else : ?> <h2>Not Found</h2> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> <?php if (is_page('15')) {?> <h3>Testimonials</h3> <?php rewind_posts(); ?> <?php query_posts('category_name=testimonials'); ?> <?php while (have_posts()) : the_post(); ?> <?php $testimonial_author = get_post_meta($post->ID, 'testimonial_author', $single = true); ?> <div class="testimonial_container"> <p class="testimonial"> “<?php the_content_rss(); ?>” </p> <?php // if there's a thumbnail if($testimonial_author !== '') { ?> <p class="testimonial_author"> — <?php echo $testimonial_author; ?> </p> <?php } // end if statement // if there's not a thumbnail else { echo ''; } ?> </div> <?php endwhile; ?> <?php } ?> </div> <?php global $post; $sidebar_id = $post->ID; get_sidebar('sidebar-'.$sidebar_id); ?> <?php get_footer(); ?>
I would really appreciate any help with this… I’m pulling my hair out!
Thanks,
Kevin
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘multiple loops and sidebar not working’ is closed to new replies.