The code you posted does not query for any content at all. To do that, use the WP_Query
object. Please do not use query_posts
, especially for secondary Loops. From the Codex:
// The Query
$the_query = new WP_Query( $args );
// The Loop
while ( $the_query->have_posts() ) :
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
endwhile;
All you need to do is provide $args
. In your case array('posts_per_page'=>3)
$args = array('posts_per_page' => 3); // or however many you want
// The Query
$the_query = new WP_Query( $args );
// The Loop
while ( $the_query->have_posts() ) :
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
endwhile;