Title: Event List Development Design
Last modified: March 1, 2017

---

# Event List Development Design

 *  Resolved [mod keys](https://wordpress.org/support/users/willibrown/)
 * (@willibrown)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/event-list-development-design/)
 * My client wants a menu item to list their “events” with a submenu of past events.
 * We do not need a calendar or ticketing or fancy plugin features.
 * I would rather not involve a plugin.
 * My thought in design approach is to just use Posts and a Category “Events” with
   a subcategory of “Past Events”.
 * Is there a way to do this so that the items populate the menu automatically?
 * Menu Hierarchy
    Events Upcoming Event 1 Upcoming Event 2 Past Events Past Event
   1 Past Event 2

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/event-list-development-design/#post-8863492)
 * I’ve not done this myself, but it should work. You need a hook that only fires
   when new posts are published, otherwise a menu item is added every time the post
   is edited. “draft_to_publish” action should serve nicely. Verify the post has
   the proper category term assigned before calling [wp_update_nav_menu_item()](https://developer.wordpress.org/reference/functions/wp_update_nav_menu_item/)
   to create a new menu item. Despite the name being for updates, it will create
   new items too.
 * I’ve never used this function before, so cannot offer specific advice. For a 
   list of proper data to provide, see the defaults list in the function’s source
   code. The same function can be used to change the title from upcoming to past
   at the appropriate time.
 * If the referenced post is deleted, the menu item should also be removed. To remove
   the menu item without removing the related post, each menu item is also a post
   of the “nav_menu_item” type. You can remove it with wp_delete_post().
 *  Thread Starter [mod keys](https://wordpress.org/support/users/willibrown/)
 * (@willibrown)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/event-list-development-design/#post-8891033)
 * Thanks. I ended up using a plugin: Category Posts in Custom Menu

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Event List Development Design’ is closed to new replies.

## Tags

 * [post-type](https://wordpress.org/support/topic-tag/post-type/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [mod keys](https://wordpress.org/support/users/willibrown/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/event-list-development-design/#post-8891033)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
