Setting the Permalink Structure
-
I have created a custom post type to manage Events and I am trying to create the permalink structure for the post. In the page I have created a custom field called Event Date using the Advanced Custom Fields plugin. I would like the permalink structure use the custom variable in the structure if possible. I have outlined the custom structure I hope to achieve below and my custom post type.
Desired Permalink Structure
/events/%Event Date Year%/%Event Date Month%/%postname%Example
/events/2014/12/My-Event-NameI would appreciate any help or advice you can provide is greatly appreciated.
Thanks,
AnthonyCustom Post Type
// Events $labels = array( 'name' => 'Events', 'singular_name' => 'Event', 'menu_name' => 'Events', 'name_admin_bar' => 'Event', 'add_new' => 'Add New', 'add_new_item' => 'Add New Event', 'new_item' => 'New Event', 'edit_item' => 'Edit Event', 'view_item' => 'View Event', 'all_items' => 'All Events', 'search_items' => 'Search Events', 'parent_item_colon' => 'Parent Events:', 'not_found' => 'No Events found.', 'not_found_in_trash' => 'No Events found in trash.' ); $args = array( 'labels' => $labels, 'public' => true, 'publicaly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-calendar-alt', 'query_var' => true, 'rewrite' => array ('slug' => 'events'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'supports' => array('title','editor', 'thumbnail') ); register_post_type ( 'Events', $args );
- The topic ‘Setting the Permalink Structure’ is closed to new replies.