Support » Fixing WordPress » one more time where does this php code go to force ascending post order

  • Resolved fatman


    <?php query_posts(‘order=ASC’); ?>

    is this the right code and if so where does it go? Please help if you are out there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Guess you want me to say your index.php file, just before The_Loop, that’s assuming your index.php file is where you are intending that to happen.

    Stepping into Templates
    Template Hierarchy

    here is my index.php file in my blog directory

    /* Short and sweet */
    define(‘WP_USE_THEMES’, true);

    do i just insert it somewhere here? i am confused by the Loop references. I am using the basic classic blue template and just want users to see my blog from the first day when they go to http://www.mydomain/blog

    can you tell me if I must insert the php statement somewhere else in a template? or different index.php file?

    also, is that a correct php command/query?

    BTW thanx for the response


    No, look at wp-content/themes/yourthemename/index.php.

    Template Hierarchy explains the other template files in your theme folder.

    no that didn’t work. this is what needs to be added and where it needs to be added for anyone else’s future reference. Since it was such a seemingly simple mod I assumed it would be easy to get to, but no.

    wordpress version 2.2.1 using blue basic theme included
    modification: to have posts appear in ascending order (from first blog entry)

    1) go to

    2) insert this line

    <?php query_posts($query_string.”&order=ASC”); ?>

    3) right after the first php command

    <?php get_header(); ?>


    4) before the “loop” statement

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

    <?php while (have_posts()) : the_post(); ?>

    hope this helps save someone else at least a few hours searching this support forum.

    It sets the posts to the initial one but doesn’t doesn’t set the sidebar calendar there as well. If anyone knows how to do this please advise.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘one more time where does this php code go to force ascending post order’ is closed to new replies.