Help With Sticky Posts and Offsets for Post Limits
-
I’m having problems with posts showing on the home page. Currently, 20 posts show on the home page. I’d like to use sticky posts for the site, but when I use sticky posts, I get the number of sticky posts + 20 posts, and it messes up the layout (which is supposed to be even).
I think I maybe should use offsets or use the counter, but I’m not sure how to get it to subtract the posts in the query from the sticky posts, so only 20 posts show at all times (including sticky posts).
Any help would be appreciated!
<div id="content" class="clearfix<?php if ($show_sidebar && get_option('thestyle_blog_style') == 'false') echo(' sidebar-fixedwidth'); ?>"> <div id="boxes" class="<?php if (!$show_sidebar) echo('fullwidth'); if (get_option('thestyle_blog_style') == 'on') echo(' blogstyle-entries'); ?>"> <?php $args=array( 'showposts' => get_option('thestyle_homepage_posts'), 'paged' => $paged, 'category__not_in' => get_option('thestyle_exlcats_recent'), 'orderby' => post_date, 'order' => ASC, ); query_posts($args); ?> <? $counter = 1; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php include(TEMPLATEPATH . '/includes/events.php'); ?> <?php $i++; ?>
- The topic ‘Help With Sticky Posts and Offsets for Post Limits’ is closed to new replies.