WordPress.org

Ready to get started?Download WordPress

Forums

Trouble with ASC entries (4 posts)

  1. kogeorge75
    Member
    Posted 8 years ago #

    Please don't get mad at me for this question. I really did search the forums before I posted this question...

    I have a blog about my fight with breast cancer at http://www.fighting-breast-cancer.com

    All last year, I was at the Mayo Clinic for Stage IV breast cancer. While I was there, I kept a journal- but I never thought about blogging until now.

    So... I am blogging right now, but I want my posts to go in ascending order. I am blogging as if I was writing last year. If I go in DESC order, it will just look like I haven't made a post since March of 2005. If you visit the site (again http://www.fighting-breast-cancer.com), you will find that I am using old dates. I am basically writing from my journal pages.

    Here is the problem:

    I figured out how to make my posts appear in ascending order by reading the forums:

    <?php
    query_posts('order=ASC');
    ?>

    However, if you visit my page...you will see that the bottom of the page only allows for "previous" entries and there are no "previous" entries. The only option on the main page should be "next" and after that..."previous" and "next" would both work.

    Right now, you can't get to my sixth ascending entry.

    The code in my template looks like this:

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','« Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries »','') ?></div>
    </div>

    So anyone have any idea why "previous" is showing up but not "next". I can see it in the code... I guess the page doesn't know I am using ASC entries?

    Thank you very much in advance. I would really appreciate any help I can get.

    (and I have donated to WordPress!)

  2. Kafkaesqui

    Posted 8 years ago #

    "Please don't get mad at me for this question. "

    Ok...

    "However, if you visit my page...you will see that the bottom of the page only allows for "previous" entries and there are no "previous" entries."

    http://wordpress.org/support/topic/57912#post-312858

    In the example code provided there, replace cat=-3 with your order=ASC. You can probably do away with the is_home() conditional test, as well.

    "and I have donated to WordPress!"

    Hey, so have I! ;)

  3. kogeorge75
    Member
    Posted 8 years ago #

    Thanks for your reply... But I don't get it. I am really not very technically saavy.

    I can't find cat=-3 anywhere in my code. That's what I am looking for, right?

    Here is the entire page:

    <?php get_header(); ?>

    <div id="main" class="main">

    <?php
    query_posts('order=ASC'); //posts in ascending order
    ?>

    <?php if (have_posts()) : ?>

    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <?php while (have_posts()) : the_post(); ?>
    <tr>
    <td class="header"><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></td>
    <td class="header"><span id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></span></td>
    </tr>
    <tr>
    <td colspan="2"><?php the_content('Read the rest of this entry »'); ?>

    <div class="comments">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','','|'); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></div>

    <?php comments_template(); ?>

    <!--
    <?php trackback_rdf(); ?>
    -->
    </td>
    </tr>
    <?php endwhile; ?>
    </table>

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','« Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries »','') ?></div>
    </div>

    <?php else : ?>

    <h2 class="center">Not Found</h2>
    <p class="center"><?php _e("Sorry, but you are looking for something that isn't here."); ?>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    ------------------------

    What am I supposed to replace exactly? I can't find the cat=-3 anywhere...

  4. Kafkaesqui

    Posted 8 years ago #

    "I can't find cat=-3 anywhere in my code."

    Not in *your* code, but in the code I linked to. Did you follow the link?

    At issue is your query_posts() call. It trumps pagination in WordPress, which means we must tell query_posts() to handle the pagination:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("order=ASC&paged=$paged");
    }
    ?>

    For an explanation, check again at the end of that link above.

Topic Closed

This topic has been closed to new replies.

About this Topic