Chicago Based WordPress, Web Hosting and Website Development

Need help with your website? Give Us a Call: 773.634.9792

WordPress Tips – How to get 10 posts and sticky posts

$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$sticky=get_option(‘sticky_posts’);
$args=array(
‘cat’=>”,
‘posts_per_page’=>10,
‘post__not_in’ => $sticky,
‘paged’=>$paged,
);
query_posts($args);

For more information please visit wordpress get_query Function Reference

Live Help

Search Our Site