Page specific menus in WordPress

I am trying to make a page specific menu in WordPress, where each page has its own options… The link is http://dev.activenation.co.uk/leisure-centre/southampton-water-activities-centre/

As you go through the “Your Centre” pages, the grey menu changes. At the moment, we are using conditional if statements to load the specific menus, however, the client will need to add more leisure centres.

Read More

Was just wondering if there was a more time saving way of doing page specific menus, instead of coding conditional if statements?

Related posts

Leave a Reply

2 comments

  1. Add a custom meta box to the ‘page’ content type that is a simple <SELECT> list of all of the custom WordPress menus. On save, pull the selected menu ID from the SELECT list and save it to the database. On the page template, check if the saved value exists and if it does, pull in the WordPress menu that has the saved ID.

    This will allow an editor to create any number of menus, pick a specific one for each page, and share like menus between pages.

    There are a lot of tutorials and code snippets around creating custom meta boxes, and displaying a simple select of the available menus. If you haven’t done custom meta boxes before, this is a good intro project since it only has one form field and it’s easy to validate the data.

    Smashing Magazine has a great walk through on custom meta boxes: http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/