-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
179 lines (149 loc) · 6.25 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
add_theme_support('post-thumbnails');
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
include_once('advanced-custom-fields/acf.php');
function new_excerpt_more( $more ) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');
set_post_thumbnail_size( 280, 200, true ); // 50 pixels wide by 50 pixels tall, crop mode
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
'header_menu' => 'Header Menu',
'footer_menu' => 'Footer Menu'
)
);
}
//ACF OPTIONS PG SET UP
if( function_exists('acf_add_options_page') ){
acf_add_options_page( 'Theme Options' );
}
// Register Custom Post Type
function Team() {
$labels = array(
'name' => _x( 'Team', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Team', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Team', 'text_domain' ),
'name_admin_bar' => __( 'Team', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'add_new_item' => __( 'Add New Item', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New Item', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
'update_item' => __( 'Update Item', 'text_domain' ),
'view_item' => __( 'View Item', 'text_domain' ),
'search_items' => __( 'Search Item', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
);
$args = array(
'label' => __( 'team', 'text_domain' ),
'description' => __( 'For the team page', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'Team', $args );
flush_rewrite_rules();
}
function Portfolio() {
$labels = array(
'name' => _x( 'Portfolio', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Portfolio', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Projects', 'text_domain' ),
'name_admin_bar' => __( 'Portfolio', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'add_new_item' => __( 'Add New Item', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New Item', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
'update_item' => __( 'Update Item', 'text_domain' ),
'view_item' => __( 'View Item', 'text_domain' ),
'search_items' => __( 'Search Item', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
);
$args = array(
'label' => __( 'portfolio', 'text_domain' ),
'description' => __( 'Portfolio page items', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'portfolio', $args );
flush_rewrite_rules();
}
function Reports() {
$labels = array(
'name' => _x( 'Reports', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Reports', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Reports', 'text_domain' ),
'name_admin_bar' => __( 'Reports', 'text_domain' ),
'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),
'all_items' => __( 'All Items', 'text_domain' ),
'add_new_item' => __( 'Add New Item', 'text_domain' ),
'add_new' => __( 'Add New', 'text_domain' ),
'new_item' => __( 'New Item', 'text_domain' ),
'edit_item' => __( 'Edit Item', 'text_domain' ),
'update_item' => __( 'Update Item', 'text_domain' ),
'view_item' => __( 'View Item', 'text_domain' ),
'search_items' => __( 'Search Item', 'text_domain' ),
'not_found' => __( 'Not found', 'text_domain' ),
'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),
);
$args = array(
'label' => __( 'Reports', 'text_domain' ),
'description' => __( 'For the reports page', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'Reports', $args );
flush_rewrite_rules();
}
add_action( 'init', 'team', 0 );
add_action( 'init', 'Portfolio', 0 );
add_action( 'init', 'Reports', 0 );
?>