Only getting 1 post in sidebar – need 2
-
My sidebar.php file has the following code. The problem is that only 1 post is being returned. Any help is greatly appreciated.
<aside> <?php get_search_form(); ?> <nav> <?php wp_nav_menu(array('menu' => 'Main Nav Menu')); ?> </nav> <div class="widget latest-post"> <h4>Latest Post</h4> <?php query_posts("post_per_page=2"); the_post(); ?> <div class="sidebar-post"> <p class="date"><?php the_date(); ?></p> <h5><?php the_title(); ?></h5> <p><?php the_content(); ?></p> </div> <?php wp_reset_query(); ?> </div> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar Widgets')) : else : ?> <!-- All this stuff in here only shows up if you DON'T have any widgets active in this zone --> <?php endif; ?> </aside>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Only getting 1 post in sidebar – need 2’ is closed to new replies.