I have a few issues I am running into. I have created a custom post in wordpress called Events.
I have a way to add a new one and view all events as well as category.
When I view all custom post pages in admin dashboard they are not in order by date. They are all over the place.
- When creating a new custom post page, I only want to choose specific categories. Not all the categories.
Here is my code below. How do I get the categories to be specific categories only. And the order of viewing all custom posts most recent in dashboard.
<code> //Custom Post Types add_action('init', 'custom_post'); function custom_post() { register_post_type('events', array( 'label' => 'Events', 'singular_label' => 'Events', 'hierarchical' => true, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => 'events'), 'capability_type' => 'post', 'taxonomies' => array( 'post_tag', 'category'), 'menu_position' => 5, 'menu_icon' => 'dashicons-calendar', 'supports' => array( 'title', 'editor', 'custom-fields', 'excerpt', 'thumbnail', 'page-attributes' ), ) ); }</code><code> //Custom Post Types
add_action('init', 'custom_post');
function custom_post() {
register_post_type('events',
array(
'label' => 'Events',
'singular_label' => 'Events',
'hierarchical' => true,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'events'),
'capability_type' => 'post',
'taxonomies' => array( 'post_tag', 'category'),
'menu_position' => 5,
'menu_icon' => 'dashicons-calendar',
'supports' => array( 'title', 'editor', 'custom-fields', 'excerpt', 'thumbnail', 'page-attributes' ),
)
);
}
</code> //Custom Post Types
add_action('init', 'custom_post');
function custom_post() {
register_post_type('events',
array(
'label' => 'Events',
'singular_label' => 'Events',
'hierarchical' => true,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array('slug' => 'events'),
'capability_type' => 'post',
'taxonomies' => array( 'post_tag', 'category'),
'menu_position' => 5,
'menu_icon' => 'dashicons-calendar',
'supports' => array( 'title', 'editor', 'custom-fields', 'excerpt', 'thumbnail', 'page-attributes' ),
)
);
}
Thank you.