PluginProbe
Virtue/Ascend/Pinnacle Toolkit / 2.6
Virtue/Ascend/Pinnacle Toolkit v2.6
trunk 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.7 3.8 All 47 releases
virtue-toolkit / post-types.php

post-types.php in Virtue/Ascend/Pinnacle Toolkit 2.6, at post-types.php

61 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Custom post types
3 function kad_portfolio_post_init() {
4 $portfoliolabels = array(
5 'name' => __('Portfolio', 'kadencetoolkit'),
6 'singular_name' => __('Portfolio Item', 'kadencetoolkit'),
7 'add_new' => __('Add New', 'kadencetoolkit'),
8 'add_new_item' => __('Add New Portfolio Item', 'kadencetoolkit'),
9 'edit_item' => __('Edit Portfolio Item', 'kadencetoolkit'),
10 'new_item' => __('New Portfolio Item', 'kadencetoolkit'),
11 'all_items' => __('All Portfolio', 'kadencetoolkit'),
12 'view_item' => __('View Portfolio Item', 'kadencetoolkit'),
13 'search_items' => __('Search Portfolio', 'kadencetoolkit'),
14 'not_found' => __('No Portfolio Item found', 'kadencetoolkit'),
15 'not_found_in_trash' => __('No Portfolio Items found in Trash', 'kadencetoolkit'),
16 'parent_item_colon' => '',
17 'menu_name' => __('Portfolio', 'kadencetoolkit')
18 );
19
20 $portargs = array(
21 'labels' => $portfoliolabels,
22 'public' => true,
23 'publicly_queryable' => true,
24 'show_ui' => true,
25 'show_in_menu' => true,
26 'query_var' => true,
27 'rewrite' => array( 'slug' => 'portfolio' ), /* you can specify its url slug */
28 'has_archive' => false,
29 'capability_type' => 'post',
30 'hierarchical' => false,
31 'menu_position' => 8,
32 'menu_icon' => 'dashicons-format-gallery',
33 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'page-attributes', 'thumbnail', 'custom-fields', 'comments' )
34 );
35 // Initialize Taxonomy Labels
36 $worklabels = array(
37 'name' => __( 'Portfolio Type', 'kadencetoolkit' ),
38 'singular_name' => __( 'Type', 'kadencetoolkit' ),
39 'search_items' => __( 'Search Type', 'kadencetoolkit' ),
40 'all_items' => __( 'All Type', 'kadencetoolkit' ),
41 'parent_item' => __( 'Parent Type', 'kadencetoolkit' ),
42 'parent_item_colon' => __( 'Parent Type:', 'kadencetoolkit' ),
43 'edit_item' => __( 'Edit Type', 'kadencetoolkit' ),
44 'update_item' => __( 'Update Type', 'kadencetoolkit' ),
45 'add_new_item' => __( 'Add New Type', 'kadencetoolkit' ),
46 'new_item_name' => __( 'New Type Name', 'kadencetoolkit' ),
47 );
48 // Register Custom Taxonomy
49 register_taxonomy('portfolio-type',array('portfolio'), array(
50 'hierarchical' => true, // define whether to use a system like tags or categories
51 'labels' => $worklabels,
52 'show_ui' => true,
53 'query_var' => true,
54 'rewrite' => true,
55 ));
56
57 register_post_type( 'portfolio', $portargs );
58 }
59 add_action( 'init', 'kad_portfolio_post_init', 1 );
60
61