The expected behavior of posts_per_page
is to NOT count sticky posts. This can be resolved with 'ignore_sticky_posts' => 1
, but then the posts don’t stick to the top of the menu. (In the trac ticket for sticky posts this issue is discussed.)
There are some workarounds like this one, but they all feel a bit hacky to me. Personally I try to just deal with the expected behavior and make sure to style the sticky
post class.
showposts
is deprecated since WP2.1 and numberposts
seems to only be a valid parameter for get_posts()
. (Although I admittedly am unsure why. There’s no mention of that issue on the Codex.)