Forums

[resolved] Excluding Pages Quick Problem (3 posts)

  1. fusillijerry89
    Member
    Posted 6 months ago #

    Hello. I want to only include 5 pages on my navigation bar (or w.e. it's called) at the top of my site livingmadegreen.com. I've read that you use something like this:
    <?php wp_list_pages('include=1,2,3,4,5&title_li='); ?>. If I remove 'title_li=' then the pages won't be displayed the way I want them to (the way they are now, with tabs for 5 pages) but right now it's only displaying the first page (id=1), but if I switch 1 and 2 so that it says 'include=2,1,3,4,5' it will still display page 1. Thanks!

  2. stvwlf
    Member
    Posted 6 months ago #

    Hi

    Include does not set the display order, only which pages are displayed.

    Display order can be set with the "order" setting on either the page edit page or in the quick edit settings. I suggest numbering your pages 5, 10, 15, 20 in the order you want them displayed.

    You will need to add this to wp_list_pages
    wp_list_pages('include=1,2,3,4,5&title_li=&sort_column=menu_order')

    Also, here is a plugin
    http://www.technokinetics.com/plugins/page-lists-plus/
    If you choose to install it, you won't need to set "include=" because you can exclude a page from being in the nav on the edit page for that page with a plugin setting. If you find that easier, install the plugin. If you are ok with the include statement, go that route.

  3. fusillijerry89
    Member
    Posted 4 months ago #

    thank you very much!

Reply

You must log in to post.

About this Topic