Hi Guys
I have a blog here - http://www.shineonraw.com/
We are trying to get the pagination to work on the homepage. We want to list all articles from the site and just paginate them. This is working on the other pages. eg - http://www.shineonraw.com/are-you-ready-to-shine/ - This pulls all the articles out from article id and paginates them.
Code for 'Are you ready to shine' -
<?php if (have_posts()) : ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=4&paged=$paged&posts_per_page=4"); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<p class="entry-date"><?php the_time('M') ?>
<span class="date"><?php the_time('j')?></span></p>
<div class="entry_header">
<h1>"><?php the_title(); ?> <?php edit_post_link('Edit', '<span class="editpost">', '</span>'); ?><?php global $id; echo '<img class="nothumb" src="/wp-content/plugins/tweet-this/icons/tt-twitter-micro1.gif" alt="Post to Twitter" />';
?> <?php if(function_exists(addtofacebook)) : addtofacebook(); endif; ?></h1>
<div class="recover"></div>
</div>
<div class="entry">
<?php
the_content();
wp_link_pages();
?>
<?php the_tags( '<p class="tags">Tags: ', ', ', '</p>'); ?>
</div>
</div>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.')?></p>
<?php endif; ?>
<?php if(isset($paged)):?>
<div class="navigation">
<p class="alignleft"><?php previous_posts_link('« Previous Page'); ?></p>
<p class="alignright"><?php next_posts_link('Next Page »'); ?></p>
<div class="recover"></div>
</div>
<?php endif; ?>
</div>
<?php //} ?>
Code for homepage -
<?php if (have_posts()) : ?>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("posts_per_page=5&paged=$paged"); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<p class="entry-date"><?php the_time('M') ?>
<span class="date"><?php the_time('j')?></span></p>
<div class="entry_header">
<h1>"><?php the_title(); ?> <?php edit_post_link('Edit', '<span class="editpost">', '</span>'); ?><?php global $id; echo '<img class="nothumb" src="/wp-content/plugins/tweet-this/icons/tt-twitter-micro1.gif" alt="Post to Twitter" />';
?> <?php if(function_exists(addtofacebook)) : addtofacebook(); endif; ?></h1>
<div class="recover"></div>
</div>
<div class="entry">
<?php
the_content();
wp_link_pages();
?>
<?php the_tags( '<p class="tags">Tags: ', ', ', '</p>'); ?>
</div>
</div>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.')?></p>
<?php endif; ?>
<?php if(isset($paged)):?>
<div class="navigation">
<p class="alignleft"><?php previous_posts_link('« Previous Page'); ?></p>
<p class="alignright"><?php next_posts_link('Next Page »'); ?></p>
<div class="recover"></div>
</div>
<?php endif; ?>
</div>
<?php //} ?>