WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] List pages by page-id (10 posts)

  1. El Scampio
    Member
    Posted 3 years ago #

    Hi, i'm utterly new to wordpress and building a site as a whole.

    I currently have 7 pages.

    I notice they are listed by alphabetical order, is there a way to change this so they are displayed by what page number they are?

    Thanks

    Nick

  2. Shane G.
    Member
    Posted 3 years ago #

  3. El Scampio
    Member
    Posted 3 years ago #

    Thanks.

    Which file do I need to adjust the code in?

  4. Safirul Alredha
    Member
    Posted 3 years ago #

    What theme are you using? Usually, there's wp_list_pages() in theme's header.php, or sidebar.php.

  5. El Scampio
    Member
    Posted 3 years ago #

    I'm using pinksimplescheme.

    It is in the header.php and have added the code so now it reads:

    <!-- begin pages -->
    <ul class="pages">

  6. ">Home
  7. <?php dp_list_pages('sort_row=menu_order'); ?>

    <!-- end pages -->

    Still listing by alphabetically

  • Safirul Alredha
    Member
    Posted 3 years ago #

    <?php wp_list_pages('sort_column=menu_order'); ?>

    sort_column not sort_row.

  • Safirul Alredha
    Member
    Posted 3 years ago #

    Oh i just noticed that it uses custom function dp_list_pages(). try replacing it with standard WordPress wp_list_pages(). Does it works like the custom one?

  • El Scampio
    Member
    Posted 3 years ago #

    I changed it to <?php wp_list_pages('sort_colum=menu_order'); ?>

    Is has worked but it has added the word "pages" in, bullet points and messed up the alignment.

  • Safirul Alredha
    Member
    Posted 3 years ago #

    That's just an example. You need to customized it according to your theme:
    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>

    see: http://codex.wordpress.org/Template_Tags/wp_list_pages#List_Pages_by_Page_Order

  • El Scampio
    Member
    Posted 3 years ago #

    Thank you so much, that has worked.

    I I offer you some of my scotch egg i'm devouring as a reward.

    Thanks again

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags