I’ve done some searches here and on Google but everything I’m finding isn’t working correctly. I was hoping to post my code here and get help with where I’m going wrong.
On the index page of my site, I have one “featured” post that has a different layout than the rest of the posts. When you click to the next page, that featured post goes away and leaves me with an uneven count of posts and I need an even post count. Here’s the code I found and have tried implementing with no joy.
I’m using the following query (everything else is the same at the count code and below):
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("paged=$page&posts_per_page=10");
?>
This is the code I want to be able to use:
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
$page_num = $paged;
if ($pagenum='') $pagenum = 1;
if ($pagenum > 1) { $post_num = 10 } else { $post_num = 9 }
query_posts('showposts=".$post_num."&paged='.$page_num); `
?>
This would be the same for the rest of the page:
<?php $count = 1; ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ((!is_paged()) && ($count == 1 )){ ?>
// FEATURED HTML HERE
<?php } else { ?>
// REGULAR HTML HERE
<?php } $count++; ?>
<?php endwhile; ?>
// PAGINATION HERE