Post Type Services
Post Type Services
// Register Custom Post Type function custom_post_type() { $labels = array( 'name' => _x( 'Services', 'Post Type General Name', 'hardocosm' ), 'singular_name' => _x( 'Service', 'Post Type Singular Name', 'hardocosm' ), 'menu_name' => __( 'Services', 'hardocosm' ), 'parent_item_colon' => __( 'Parent Services:', 'hardocosm' ), 'all_items' => __( 'All Services', 'hardocosm' ), 'view_item' => __( 'View service', 'hardocosm' ), 'add_new_item' => __( 'Add New Service', 'hardocosm' ), 'add_new' => __( 'New Service', 'hardocosm' ), 'edit_item' => __( 'Edit Service', 'hardocosm' ), 'update_item' => __( 'Update Service', 'hardocosm' ), 'search_items' => __( 'Search service', 'hardocosm' ), 'not_found' => __( 'No service found', 'hardocosm' ), 'not_found_in_trash' => __( 'No services found in Trash', 'hardocosm' ), ); $rewrite = array( 'slug' => 'service', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'label' => __( 'services', 'hardocosm' ), 'description' => __( 'Services', 'hardocosm' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ), 'taxonomies' => array( 'type' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-editor-ul', 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'post', ); register_post_type( 'services', $args ); } // Hook into the 'init' action add_action( 'init', 'custom_post_type', 0 );