Hi all,
I'm trying to link posts in wordpress. Let me elaborate. In wordpress, you can set how many posts you want to show on a page. If, for example, you set that number to 1, and you have 10 posts, then you'll have 10 pages.
I have the following code that WORKS on the index.php (main posts page). It shows a link to older posts. Below is the code:
<ul id="postNavigation">
<li class="floatLeft"><?php next_posts_link('Old posts »') ?></li>
<li class="floatRight"><?php previous_posts_link('« New posts') ?></li>
</ul>
Now, the way I have my wordpress set up, I have another page where I show posts with a certain category using this code (this code is in my page.php file):
<?php if ( is_page('newspaper') ) { // BEGINNING of newspaper page
?>
<?php $my_query = new WP_Query('category_name=newspaper'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="post">
<!--<h3><?php the_title(); ?></h3>-->
<?php the_content('Read the rest of this entry »'); ?>
<div class="clear"></div>
</div>
<?php endwhile; ?>
<ul id="postNavigation">
<li class="floatLeft"><?php next_posts_link('Old Posts »') ?></li>
<li class="floatRight"><?php previous_posts_link('« New Posts') ?></li>
</ul>
<?php } //END of newspaper page
?>
However, it doesn't show the "Older posts" link there. Does anyone have any idea if and how this is possible to accomplish?
Thanks, Amit