Page Navigation in WordPress – Using Sort Order

by Scott Ellis on July 28, 2009

in Content Management, WordPress How To

0

The following video provides an explanation on how to use sort order so that you get a scalable and organized approach to managing your navigation in WordPress. While geared at WordPress sites, this approach should work for any content management system that provides an automated or semi-automated way of creating navigation. This tutorial assumes that you are using a theme which supports multilevel navigation (i.e. drop down menus) and have a basic familiarity with using WordPress to edit and create content. You will also want to note this tutorial reference the function wp_list_pages(); and includes the parameter “sort_column=menu_order” (e.g. wp_list_pages(’sort_column=menu_order’); ). For more on wp_list_pages and it’s parameters visit the WordPress Codex.

Related Posts:

  • Alex
    Thanks. You just saved me a ton of (future) time.
  • Alex! You bet... that is the idea!
  • Thanks for the EASY guide! Much appreciated.
  • Thanks for the tips
  • Kaka, you bet.
  • Guest
    above video is not working... it shows the message " Sorry, the video is currently not available".....
  • Sorry for the delay but I was traveling when you sent this. I checked it and it seems to be working. Thanks for letting me know though.
  • Just wanted to say this is a very smart idea! In addition, I have started using a plugin "My Page Order" which is a very small plugin that lets you sort your pages and drill down to sort sub pages as well using an easy drag and drop. The URL is http://wordpress.org/extend/plugins/my-page-order/ and it's very handy! It's not yet updated for 2.9 yet since WordPress added the trash feature for pages but the author has said he's working on an update since 2.9 does not include a better way to sort pages.
  • Andrew, thank you, I appreciate that. My Page Order is a good plugin. My personal preference is that I tend to prefer to not use plugins for what I can do with core WordPress functionality. 1) For the reason you mentioned, it's a pain sometimes waiting for a plugin that has to get worked when a new version of WordPress is released. 2) It keeps everything lighter (fewer moving parts mean fewer points of failure where things can go wrong). That said, I use a lot of plugins, just not where it isn't necessary. Still, I know that plugin makes things easier for a lot of people so enjoy and upgraded to 2.9 as soon as you can. Always a good idea to stay up to date on that.
  • bran
    hello. I just soaked up your workpress video, content map, very helpful ... my question, wanting your recommendation, using wordpress as a blog, I see the smart uses of 'catagories' and the use of 'tags' as you explained ... but how best should I think about this if I want to set up a 'portfolio' section of graphic work, a page parent with sub pages, that remains separate from posts tagged with categories ... do you recommend setting portfolio under a 'static' page so its available on my main nav? or as 'catagory' or as a 'static' page? Both a category and static page?

    That said, how would my subs of: print, web, ID, for instance be best served? My goal is to set up a 'portfolio' that remains full of just my work, not pulling in other elements, say blog posts with the same tag or catagory... Is it correct to think if I do this I need to reserve specific 'catagory' and 'tags' just for my porfolio section? Hope that makes sense. Again, thanks for the video content map ... it was very helpful.
  • Bran, I would probably set it up as a category called "Portfolio". You could also create sub-categories for portfolio types (print portfolio, web portfolio, etc...). In WordPress you can create a specific category template so that that main category page will look different than the usual category page. This helps because if you wanted the main page for "Print Portfolio" to look slightly different than "Web Portfolio" it's just a matter of creating different category templates. If you don't know css and html and a little php you'll need someone to create them for you. (Feel free to contact me if you need a quote).

    Underneath each category you would create a post for the particular "work" you are showing off. So if you create a portfolio of website's you've built then each site would be a post.. make sense?

    The top level portfolio page (category page, not static page) could show various works from all of the sub-categories of "Portfolio" or the most recent example from each... however you want it to work. Again, this kind of templating takes some coding but can definitely be done.

    I would then think about tags for the individual category types. For example under the "Print Portfolio" category what are the logical tags (think of search terms) that people would want to see work based on.

    Ideas might be:

    Magazine Ad
    Brochure
    Poster
    Postcards
    Business Cards
    ...
  • I see how you make a page the default home page and then how you add other pages and sub pages, but after doing that how do you create a menu item for your posts (the blog entries)?
  • Chris, you have to use the function wp_list_categories() and whatever parameters you want to go with that. Note: categories will not show up in the menu if there are no posts in that category.
    Also, you'll need to style the menu accordingly, depending on whether or not your theme supports it.

    See more in the codex: wp_list_categories();
  • nice tips - 1000,2000 - good idea
  • ecmuscle, glad you like. It's a fairly "old school" idea but still works well!
  • Ruby, You should just be able to login to the backend and go to Pages > Purchase and edit your content. If that doesn't work we'll have to login and take a look.
  • Using 4 digits to control sort order, good idea that works.
    Thanks for sharing.
  • Ruby Koerper
    I have a new web site--5 pages---I want to change the wording on the Purchasing page and also delete one line--have not figured out how to do that.

    I did add two review to my Review page earlier with no problems, Thanks for any assistance, Ruby
  • Ruby, Sorry for the long delay. I assume you are on wordpress? From what you described can't you just go to the Page and change the words? I tried to go to your site but it isn't coming up. Let me know...
  • Thank you! Wonderful idea and it is very smart way to sort!
  • Carlos, Glad you found it useful! More to come...
  • Yeah, DB digits could get messy! Glad this helps!
  • I like it! I had gotten to the point of db digits, don't know why I didn't think of this earlier!! :)
  • Andy, That is a slightly more technical issue. You have to use the wp_list_pages() function. See the list of Template Tags on Wordpress.org for more details but you'll likely need to tell it what pages to include or which ones to ignore unless you want it to show every page in your site on your nav (not likely unless you only have a couple pages). Also, most WordPress themes are set up to support horizontal navigation (at least the themes I've built, used, delt with ..) but you'll want to be sure yours has the css for that. If not you'll get a vertical list of pages without the formatting you're looking for since the wp_list_pages() tag will spit out an unordered list ul & li html tags respectively.
  • andy
    Thanks for the tips! One thing I am still not sure of is how you get the pages then to go into your top navigation like on your site???
blog comments powered by Disqus

Previous post:

Next post: