WordPress.org

Ready to get started?Download WordPress

Forums

Order of Posts (10 posts)

  1. warj00
    Member
    Posted 8 years ago #

    Is there a way to order posts in a page ?

    i.e.
    would like to change the current 3 2 1 to 1 2 3

  2. jaredquinn
    Member
    Posted 8 years ago #


    query_posts("order=date&order=ASC");

    Adding a query_posts like above before The Loop should do the trick.

  3. warj00
    Member
    Posted 8 years ago #

    I'm not clear on the loop part, which page would I place it in the index page or the archive page

    should the above example be placed in side php brackets ?

  4. jaredquinn
    Member
    Posted 8 years ago #

    Do you want to change the order of posts on the index or archive pages?

    That would determine where you put it.

    The Loop is explained on the codex page that The Loop (both above and here) links to. It is the core of WordPress, the thing in your index and other template pages that looks like:

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

  5. warj00
    Member
    Posted 8 years ago #

    ic well where ever there are posts i'd like it to be 1 2 3 vs 3 2 1 as it is now

    I've read numerous posts and still have not been able to get anything to work

    are posts from the index or the archive

  6. skulled
    Member
    Posted 8 years ago #

    Post are both in the index and the archive pages, how they are displayed varies according to what you are viewing.

    Both the index.php and the archive.php page of your theme have the Loop, so you need to change it in both places accordingly ..

  7. warj00
    Member
    Posted 8 years ago #

    ok I tried it and placed in both pages but still didn't work, seems like that code is missing some items no ?

  8. skulled
    Member
    Posted 8 years ago #

    Can you please post the code that you inserted, or the complete code from your index.php and archive.php files at this website, and provide the links here:

    http://pastebin.com

  9. warj00
    Member
    Posted 8 years ago #

    i got a plugin called custom query string, that sorted it like magic

  10. skulled
    Member
    Posted 8 years ago #

    Excellent .. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.