Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Cursos post type

if ( ! function_exists('apk_cursos_post_type') ) {

// Register Custom Post Type
function apk_cursos_post_type() {

	$labels = array(
		'name'                => _x( 'Cursos', 'Post Type General Name', 'apk' ),
		'singular_name'       => _x( 'Curso', 'Post Type Singular Name', 'apk' ),
		'menu_name'           => __( 'Cursos', 'apk' ),
		'parent_item_colon'   => __( 'Superior:', 'apk' ),
		'all_items'           => __( 'Todos', 'apk' ),
		'view_item'           => __( 'Ver cursos', 'apk' ),
		'add_new_item'        => __( 'Agregar curso', 'apk' ),
		'add_new'             => __( 'Agregar nuevo', 'apk' ),
		'edit_item'           => __( 'Editar', 'apk' ),
		'update_item'         => __( 'Actualizar', 'apk' ),
		'search_items'        => __( 'Buscar', 'apk' ),
		'not_found'           => __( 'No se ha encontrado', 'apk' ),
		'not_found_in_trash'  => __( 'Nada en la pepelera', 'apk' ),
	);
	$rewrite = array(
		'slug'                => 'cursos',
		'with_front'          => false,
		'pages'               => true,
		'feeds'               => true,
	);
	$args = array(
		'label'               => __( 'cursos', 'apk' ),
		'description'         => __( 'Cursos', 'apk' ),
		'labels'              => $labels,
		'supports'            => array( 'title', 'excerpt', 'thumbnail', 'page-attributes', ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 20,
		'menu_icon'           => 'dashicons-welcome-learn-more',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'rewrite'             => $rewrite,
		'capability_type'     => 'page',
	);
	register_post_type( 'cursos', $args );

}

// Hook into the 'init' action
add_action( 'init', 'apk_cursos_post_type', 0 );

}