Problem with sidebar and main content
-
Hi I have made a template with a sidebar and main content column, however when i switch on both the sidebar and content column no content is displayed in the content column, only the sidebar. When i disable the sidebar then the content column is populated with the loop. So I am thinking that there is some problem with my sidebar or main content (page.php) code. Can anybody take a look and see if there is ssomething wrong?
Sidbar.php
<div id="sidebar"> <div id="sidebar-top"></div> <h2>Latest News</h2> <?php $count=0; $posts_per_page=2; query_posts('cat=3&posts_per_page='. $posts_per_page ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h3><?php the_title(); ?></h3> <p><?php the_content(); ?></p> <?php $count++; if ($count < $posts_per_page) { ?> <div class="hr"><hr /></div> <?php } ?> <?php endwhile; endif; ?> <?php get_a_post(25); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php get_a_post(29); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <div id="sidebar-bottom"></div> </div> <!-- sidebar -->
Page.php
<?php get_header(); ?> <div id="content"> <?php get_sidebar(); ?> <div id="content-main"> <div class="content-box"> <div class="content-box-top"></div> <div class="content-box-middle"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h2><?php the_title(); ?></h2> <div class="content-box-middle-gradient"> <?php the_content(); ?> </div> <!-- content-box-middle-gradient --> <?php endwhile; endif; ?> </div> <!-- content-box-middle --> <div class="content-box-bottom"></div> </div> <!-- content-box --> </div> <!-- content-main --> </div> <!-- content --> <?php get_footer(); ?>
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Problem with sidebar and main content’ is closed to new replies.