Why does this display 10 WordPress items instead of five?

I have the code working but instead of displaying the 5 most recent items it displays 10.

<div id='cssmenu'>
    <ul>
    <?php
    $args = array(
        'posts-per-page' => 5,
        'cat'      => 11,
        'order'    => 'DESC'
    );
    query_posts( $args );
    if (have_posts()) :
        while (have_posts()) : the_post();
            echo "<li><a href='" . get_permalink() . "' class='post-wrap'>
                <span class='post-loop-image'>";
                    if ( has_post_thumbnail() ) {
                        the_post_thumbnail();
                    }
                    else{
                        echo "<img src='http://i0.wp.com/hanahanpolice.com/wp-content/uploads/2013/04/unknown_person.png?fit=1200%2C1200' alt='default' />";
                    }
                echo "</span>";
            echo "<span class='wanted'>";
            the_title();
            echo "</span></span></a></li>" ;
         endwhile;
    endif;
    wp_reset_query();
    ?>
...See all Wanted   

</ul>

</div>

It is probably something simple that I am missing but I am at a lost. Thanks for help in advance!

Related posts

Leave a Reply

2 comments

  1. Taken from the WP documentation:

    Note: This function isn’t meant to be used by plugins or themes. As
    explained later, there are better, more performant options to alter
    the main query. Double Note: query_posts() is overly simplistic and
    problematic way to modify main query of a page by replacing it with
    new instance of the query. It is inefficient (re-runs SQL queries) and
    will outright fail in some circumstances (especially often when
    dealing with posts pagination). Any modern WP code should use more
    reliable methods, like making use of pre_get_posts hook, for this
    purpose. TL;DR don’t use query_posts() ever;

    Use WP_Query instead, for example:

    <?php
    $args = array(
        'posts_per_page' => 5,
        'cat'      => 11,
        'order'    => 'DESC'
    );
    $the_query = new WP_Query( $args );
    if ( $the_query->have_posts() ) {
    .....