Cricket Menus

Cricket Menus

Top menu

The standard twentyEleven theme provides two alternative menu options:

  • Standard ‘Auto-generated’ menu
  • One custom menu

Cricket updates the custom menu so that the auto-generated menu shows draft and private pages that are visible to the user when the user is logged in.

Pathway menu

In addition to the standard menu, there is a pathway under the standard menu that displays the path to the current page.

Side menus

Cricket allows additional quick-link side menus to be created such as on the right hand side of this page.

To create such a menu, create a side post of type ‘Link Menu’.  And text, links, pictures etc will be added to the top of the list. This can be left blank.   The remainder of the menu is created by using Appearance/menus, and creating a menu with the same name as the title of the post.   This will automatically be added to the bottom of the menu when displayed.

The advantage of the first part of the menu allows free text, pictures etc to be added to menu, something that is not possible with the standard WordPress menus.

Note that when logged in a person who can edit such posts sees the two components of the menus displayed separately.

 

Implementation

Top menu

In the header code the standard call to wp_nav_menu includes a list of the post/pages statuses that should appear in the menu.

Pathway menu

Additional code in header.php

Side menus

The code for displaying side posts appears in both the summary page and the content page, so in both cases this calls GetSidePosts() in functions.php which provides common code for both cases.   It in turn calls postPost() for each post which looks for link items and calls the getMenu code when it is seen.