I would like to get help with a issue I’m having with the WordPress sticky posts function.
I cant figure it out how to make the stick post stick to the beginning of the loop. I have a loop similar to his:
<?php query_posts('cat=10&posts_per_page=3');?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
And I would like it to work like this:
- Sticky post
- Ordinary post
- Ordinary post
Instead for:
- Ordinary post
- Sticky post
- Ordinary post
Thanks for the help!
My solution here http://codex.wordpress.org/Class_Reference/WP_Query
I made two queries, in this case I’m not using pagination maybe this can help
I tested this on my Demo site. And the default order should be:
– sticky
– ordinary
– ordinary
The default order is NOT
– ordinary
– sticky
– ordinary
I recommend testing it with other theme’s, like twentyten.
From there it is probably basic debugging
check this:
http://codex.wordpress.org/Sticky_Posts