Thanks very much. I have now added the s in posts_per_page. I’m still baffled though. I have 2 published posts and I want them to both show up in the sidebar. Only one is showing up.
my_site
my mistake – I stopped checking after the first spotted error;
actually your code does not have ‘the loop’, i.e. the while( have_posts() )
… endwhile
is missing;
change to:
<?php query_posts("posts_per_page=2"); while( have_posts() ) : 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 endwhile; wp_reset_query(); ?>
Awesome! You totally rock! That’s perfect. Two posts in sidebar. Thank you so much.