Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

rd mag eventy

if ( ! function_exists('custom_post_type_eventy') ) {

// Register Custom Post Type
function custom_post_type_eventy() {

	$labels = array(
		'name'                  => _x( 'Eventy', 'Post Type General Name', 'text_domain' ),
		'singular_name'         => _x( 'Event', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'             => __( 'Eventy', 'text_domain' ),
		'name_admin_bar'        => __( 'Eventy', 'text_domain' ),
		'archives'              => __( 'Archív eventov', 'text_domain' ),
		'attributes'            => __( 'Vlastnosti', 'text_domain' ),
		'parent_item_colon'     => __( 'Nadradená položka', 'text_domain' ),
		'all_items'             => __( 'Všetky eventy', 'text_domain' ),
		'add_new_item'          => __( 'Pridať nový event', 'text_domain' ),
		'add_new'               => __( 'Pridať nový', 'text_domain' ),
		'new_item'              => __( 'Nový event', 'text_domain' ),
		'edit_item'             => __( 'Upraviť event', 'text_domain' ),
		'update_item'           => __( 'Aktualizovať event', 'text_domain' ),
		'view_item'             => __( 'Zobraziť event', 'text_domain' ),
		'view_items'            => __( 'Zobraziť eventy', 'text_domain' ),
		'search_items'          => __( 'Vyhľadať event', 'text_domain' ),
		'not_found'             => __( 'Nenájdené', 'text_domain' ),
		'not_found_in_trash'    => __( 'Nenájdené v koši', 'text_domain' ),
		'featured_image'        => __( 'Prezentačný obrázok', 'text_domain' ),
		'set_featured_image'    => __( 'Nastaviť prezentačný obrázok', 'text_domain' ),
		'remove_featured_image' => __( 'Odstrániť prezentačný obrázok', 'text_domain' ),
		'use_featured_image'    => __( 'Použiť ako prezentačný obrázok', 'text_domain' ),
		'insert_into_item'      => __( 'Vložiť do eventu', 'text_domain' ),
		'uploaded_to_this_item' => __( 'Nahrať do tohto eventu', 'text_domain' ),
		'items_list'            => __( 'Zoznam eventov', 'text_domain' ),
		'items_list_navigation' => __( 'Navigácia zoznamu', 'text_domain' ),
		'filter_items_list'     => __( 'Filtrovať zoznam', 'text_domain' ),
	);
	$args = array(
		'label'                 => __( 'Event', 'text_domain' ),
		'description'           => __( 'Eventy', 'text_domain' ),
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'post-formats' ),
		'taxonomies'            => array( 'eventy_category', 'eventy_post_tag' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-video-alt',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => false,
		'has_archive'           => false,
		'exclude_from_search'   => true,
		'publicly_queryable'    => true,
		'capability_type'       => 'post',
	);
	register_post_type( 'event', $args );

}
add_action( 'init', 'custom_post_type_eventy', 0 );

}