Previous and Next Entries Link
-
I believe this is my first time asking a question, and I wish I didn’t have to. Here it goes, please be nice…
I’m trying to add a link at the bottom of the first page of the blog I’m working on that says ‘Previous Entries’ and links to page/2.
Seems simple enough, but every codex example I’ve tried either showed the next and previous post from the last post on the first page OR showed nothing at all.
So, I assume there is something up with my loop. Probably, because its a weird loop:
<?php if (is_page()) { $cat=get_cat_ID($post->post_title); //use page title to get a category ID $posts = get_posts ("cat=-27,$cat&showposts=5"); if ($posts) { foreach ($posts as $post): setup_postdata($post); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
At the end of the loop I ask for the previous and next links:
<?php endforeach; } } ?> <div class="previous"><?php previous_post_link('PREVIOUS POST: %link') ?></div> <div class="next"><?php next_post_link('NEXT POST: %link') ?></div>
I realize in this example I’m using previous_post_link. I’ve used everything and nothing works properly.
The site I’m working on is here: http://jeneth.com
Any help would be spectacular. I hope I’m missing something easy and silly, but I need another set of eyes…mine are tired.
Thank you very much for reading.
- The topic ‘Previous and Next Entries Link’ is closed to new replies.