Forums

Trouble with viewing older posts (9 posts)

  1. RyLoree
    Member
    Posted 1 year ago #

    I am using wordpress theme twenty ten. I wanted to sort my posts in ascending order so I did a search through this forum. I found my answer and am using this code..
    <?php query_posts('order=ASC'); ?>
    in the index.php file

    I thought everything worked great, until I noticed that when you select the link to older posts (which should say newer posts) at the top or the bottom of the page you aren't brought to older posts(or newer posts). It just brings up the same pages.

    website is http://www.expecting-twins.com

    Any help would be greatly appreciated.
    Thamnks

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Don't edit the Twenty Ten theme. Your changes will be over-written the next time you upgrade WordPress. For this reason, it is recommended that you consider creating a child theme for your customisations. Once your child theme is active, we should be able to help with the customisation.

  3. RyLoree
    Member
    Posted 1 year ago #

    Thanks,

    I'll let you know when I'm done.

  4. RyLoree
    Member
    Posted 1 year ago #

    I have created a child theme for the twentyten theme. How do I update the index.php file in my child theme?

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note

    the example is exactly what you are looking for.

  6. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Try adding:

    global $query_string;
    query_posts( $query_string . '&order=ASC' );

    just before get_template_part( 'loop', 'index' ); in your child's index.php template file.

  7. RyLoree
    Member
    Posted 1 year ago #

    Thanks,
    works great.. just one more thing..
    Can I change the older posts link to say newer posts?

  8. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Pretty sure you can't do that without creating your own child loop-index.php.

  9. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    just change the wording?

    follow @esmi's suggestion; copy loop.php from the parent them into the child theme; edit it there;
    find one section near the beginning:

    <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>

    same again near the end.

Topic Closed

This topic has been closed to new replies.

About this Topic