I must get assist with a problem I am getting using the WordPress sticky posts function.

I cant decipher it steps to make the stick publish stay with the start of the loop. I've got a loop much like his:

<?php query_posts('cat=10&posts_per_page=3');?>  
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?> 

And That I wish it to work such as this:

  • Sticky publish
  • Regular publish
  • Regular publish

Rather for:

  • Regular publish
  • Sticky publish
  • Regular publish

Just help!

I examined this on my small Demo site. And also the default order ought to be: - sticky - regular - regular The default order isn't - regular - sticky - regular

I suggest testing it along with other theme's, like twentyten. After that it's most likely fundamental debugging take a look: http://codex.wordpress.org/Sticky_Posts

My solution here http://codex.wordpress.org/Class_Reference/WP_Query

I made two queries, within this situation I am not using pagination maybe this might help

    $sticky = get_option( 'sticky_posts' );
    $args_nonsticky = array(
        'showposts'     => -1,
        'post__not_in' => $sticky
    $args_sticky = array(
        'posts_per_page' => -1,
        'post__in'  => $sticky

    $the_query_sticky = new WP_Query($args_sticky); 
    $the_query_nonsticky = new WP_Query($args_nonsticky);

    if(!$the_query_sticky->have_posts() && !$the_query_nonsticky->have_posts()){
        //echo '<h1>NO POSTS FOUND</h1>';

    if ( $sticky[0] ) {
    while ($the_query_sticky->have_posts()) : $the_query_sticky->the_post(); 
      //sticky if so...

    while ($the_query_nonsticky->have_posts()) : $the_query_nonsticky->the_post(); 
        // non sticky