Support » Fixing WordPress » Previous Entries Problem

  • Hi,
    I am having problems with the “previous entries” link on my wordpress installation at http://alanwho.com

    It is not showing previous entries, instead it’s just showing whats on my home page.

    I have tried using conditional tags to separate whats on my home page and the other pages but index.php seems to use the first tag “home” when on the “previous entries” pages …

    I am using the following code:

    [Moderated: Too much code. Please consider placing the code in a text file on your site with a link here -or- use a pastebin service such as http://wordpress.pastebin.ca. Thanks!]

    I notice there have been similar requests at

    http://wordpress.org/support/topic/95999?replies=12

    http://wordpress.org/support/topic/88045?replies=11

    But there doesn’t seem to be a definitive answer to get the “previous entries” link working for people with customized home pages.

    Any definitive answer that could help get the “previous entries” link working for me would be fantastic!

    Regards,

    Alan

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter adapting

    (@adapting)

    My original topic was edited because the code was too detailed.

    My problem still exists: Whenever I use the “query_posts” function in a basic loop, the “previous entries” and “next entries” link don’t actually show previous entries – they just show what is on the index page.

    My loop starts with:

    <?php query_posts('cat=-48,-50,-49'); ?>
    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    	<!-- open post --><div class="post" id="post-<?php the_ID(); ?>">

    And ends with:

    <!-- close post--></div>
    
    <?php endwhile; ?>
    
    <!-- open post-nav -->
    <div class="post-nav">
    <span class="previous"><a href="http://thevdo.com/test-2/">
    <small><?php next_posts_link('<< Previous Entries') ?></small></span>
    <span class="next"><a href="http://thevdo.com/10-photoshop-secrets/">
    <small><?php previous_posts_link('Next Entries >>') ?></small></a></span>
    <!-- close post-nav --></div>
    
    <?php else : ?>
    
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.
    
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    <?php endif; ?>

    An example of the problem can be seen at http://alanwho.com and http://alanwho.com/page/2/ where previous entries should appear, but don’t.

    I ‘ve got a problem, no one else can help, maybe I should hire the A team?

    Any members of the A team should post replies below:

    Thank you

    Alan.

    Thread Starter adapting

    (@adapting)

    After intense google searches I have found an answer …

    Using the following code to exclude categories 48, 50 and 49 seems to ensure that the previous and next entries links stop working <?php query_posts('cat=-48,-50,-49'); ?>

    The solution for my particular problem is the below code which still exclude categories 48, 50 and 49 and most importantly displayers older posts properly.

    <?php
    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=-48,-50,-49&showposts=10&paged=$page");
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Previous Entries Problem’ is closed to new replies.