Support » Fixing WordPress » How do I get pages in order AND exclude some?

  • Hi all,

    I’m new to WordPress and not very familiar with how to combine code for two different things. What I need to do is list my pages in the sidebar in the order I set AND exclude certain pages at the same time. Any idea how I would do this? Thanks…

Viewing 4 replies - 1 through 4 (of 4 total)
  • see http://codex.wordpress.org/Template_Tags/wp_list_pages

    try

    <?php wp_list_pages('sort_column=menu_order&exclude=17,18,25'); ?>

    where you want to exlude pages with IDs 17,18, and 25.

    Hi,

    Thanks…yes, I saw that page, and that helps with the exclude function but not the order sorting…

    Well, it should solve both. I’m using two arguments for the wp_list_pages() funtion.

    sort_column=menu_order
    exclude=17,18,25

    This should sort the pages by the ‘page order’ setting found when editting any page. This should also exclude #17, #18, and #25.

    Again altogether:

    <?php wp_list_pages('sort_column=menu_order&exclude=17,18,25'); ?>

    Oops, I’m sorry, I misread your code! Thanks so much for your help 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How do I get pages in order AND exclude some?’ is closed to new replies.