Support » Fixing WordPress » changing order of pages in list of pages

  • niros


    hi everybody.
    i’m not a skillful code writer, but i imagine what i want is possible to do, and i hope someone knows how to help me.
    i have a page in my website that shows a list of all of the pages in it. the code in it’s center goes like this:

    <h2><?php _e('Pages', 'hemingway'); ?></h2>
    <ul class="pages">
    <?php wp_list_pages('title_li='); ?>

    here’s a link [it’s in Hebrew]:

    here is what i want:
    1. currently the list shows pages according to their order number, and i want to reverse the list. i want it to show newest pages, or pages with a larger number first, and older pages, or pages with a smaller number last.
    2. currently the list shows all of my pages in the same list, and i want it to split the list to different pages. i want it to show only 15 pages at a time, and a “previous / next” button in the bottom, for lists of older or newer pages.

    if anyone knows how to do it, i’ll be very thankful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Rachel Baker


    The wp_list_pages function information is covered in the Codex here:

    You can modify your code to
    <?php wp_list_pages('sort_order=DESC&number=15&title_li='); ?>

    That will display the pages in the opposite order and only display 15 of them, however I recommend using the WP Query function where you can page the results into increments of 15 as you desire.



    thank you very much!
    it’s so fun to learn new things :-]

    here’s the new problem:
    now the list shows only 15 pages, and i want to have in the bottom a link to the previous 15 pages, and there to have a link to the previous or next list etc.
    somewhat like the list i have as an admin in my control pannel.

    how can that be done?
    thanks :-]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘changing order of pages in list of pages’ is closed to new replies.