Page Content In Sidebar Instead of Post Content
-
My page content is being displayed in my sidebar instead of my posts. I am new to wordpress, so I apologize if the answer is simple. I have my front page set to “home” and my posts page set to news. On the news page the posts show up in the sidebar, but I imagine that is because the posts are the content of this page. I am creating my own theme, but working off of a Starker’s 2.0 theme.
Here is my sidebar.php code:
<?php ?> <ul id="sidebar"> <?php if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?> <li class="widget"> <h2>Recent News</h2> <ul> <?php if(have_posts()) : while(have_posts()) : the_post(); ?> <li><a href="<?php the_permalink(); ?>"> <h3><?php the_title(); ?></h3> <p class="meta"><?php the_date(); ?></p> <?php the_content('Read More...'); ?></a> </li> <?php endwhile; ?> <?php else : ?> <p> Nada </p> <?php endif; ?> <h2><a href="#">Lea Mas >></a></h2> </ul> </li> <?php endif; // end primary widget area ?> </ul> <?php // A second sidebar for widgets, just because. if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?> <ul class="xoxo"> <?php dynamic_sidebar( 'secondary-widget-area' ); ?> </ul> <?php endif; ?>
Let me know if you know how to fix this issue. I can’t seem to find information online about when the loop calls page content and in what circumstances it calls post content.
Thanks,
Sean
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Page Content In Sidebar Instead of Post Content’ is closed to new replies.