-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
129 lines (124 loc) · 6.54 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
<?php
/**
* Proweb365 functions and definitions
*
* @package Proweb365
*/
require get_template_directory() . '/inc/init.php';
// add_action('after_setup_theme', 'remove_admin_bar');
// function remove_admin_bar()
// {
// if (!current_user_can('administrator') && !is_admin()) {
// show_admin_bar(false);
// }
// }
show_admin_bar(false);
// Register Custom Post Type
function custom_post_type_sanpham()
{
$labels = array(
'name' => _x('Các Sản Phẩm', 'Post Type General Name', 'text_domain'),
'singular_name' => _x('Sản Phẩm', 'Post Type Singular Name', 'text_domain'),
'menu_name' => __('Các Sản Phẩm', 'text_domain'),
'name_admin_bar' => __('Sản Phẩm', 'text_domain'),
'archives' => __('Item Archives', 'text_domain'),
'attributes' => __('Item Attributes', 'text_domain'),
'parent_item_colon' => __('Parent Item:', 'text_domain'),
'all_items' => __('Tất cả Sản Phẩm', 'text_domain'),
'add_new_item' => __('Thêm Sản Phẩm', 'text_domain'),
'add_new' => __('Thêm Sản Phẩm', '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'),
'view_items' => __('View Items', 'text_domain'),
'search_items' => __('Search Item', 'text_domain'),
'not_found' => __('Not found', 'text_domain'),
'not_found_in_trash' => __('Not found in Trash', 'text_domain'),
'featured_image' => __('Featured Image', 'text_domain'),
'set_featured_image' => __('Set featured image', 'text_domain'),
'remove_featured_image' => __('Remove featured image', 'text_domain'),
'use_featured_image' => __('Use as featured image', 'text_domain'),
'insert_into_item' => __('Insert into item', 'text_domain'),
'uploaded_to_this_item' => __('Uploaded to this item', 'text_domain'),
'items_list' => __('Items list', 'text_domain'),
'items_list_navigation' => __('Items list navigation', 'text_domain'),
'filter_items_list' => __('Filter items list', 'text_domain'),
);
$args = array(
'label' => __('Sản Phẩm', 'text_domain'),
'description' => __('Post Type Description', 'text_domain'),
'labels' => $labels,
'supports' => array('title', 'editor', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', 'post-formats'),
'taxonomies' => array('category', 'post_tag'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-welcome-write-blog',
'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('san_pham', $args);
}
add_action('init', 'custom_post_type_sanpham', 0);
function custom_post_type_dichvu()
{
$labels = array(
'name' => _x('Các Dịch Vụ', 'Post Type General Name', 'text_domain'),
'singular_name' => _x('Dịch Vụ', 'Post Type Singular Name', 'text_domain'),
'menu_name' => __('Các Dịch Vụ', 'text_domain'),
'name_admin_bar' => __('Dịch Vụ', 'text_domain'),
'archives' => __('Item Archives', 'text_domain'),
'attributes' => __('Item Attributes', 'text_domain'),
'parent_item_colon' => __('Parent Item:', 'text_domain'),
'all_items' => __('Tất cả Dịch Vụ', 'text_domain'),
'add_new_item' => __('Thêm Dịch Vụ', 'text_domain'),
'add_new' => __('Thêm Dịch Vụ', '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'),
'view_items' => __('View Items', 'text_domain'),
'search_items' => __('Search Item', 'text_domain'),
'not_found' => __('Not found', 'text_domain'),
'not_found_in_trash' => __('Not found in Trash', 'text_domain'),
'featured_image' => __('Featured Image', 'text_domain'),
'set_featured_image' => __('Set featured image', 'text_domain'),
'remove_featured_image' => __('Remove featured image', 'text_domain'),
'use_featured_image' => __('Use as featured image', 'text_domain'),
'insert_into_item' => __('Insert into item', 'text_domain'),
'uploaded_to_this_item' => __('Uploaded to this item', 'text_domain'),
'items_list' => __('Items list', 'text_domain'),
'items_list_navigation' => __('Items list navigation', 'text_domain'),
'filter_items_list' => __('Filter items list', 'text_domain'),
);
$args = array(
'label' => __('Dịch Vụ', 'text_domain'),
'description' => __('Post Type Description', 'text_domain'),
'labels' => $labels,
'supports' => array('title', 'editor', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', 'post-formats'),
'taxonomies' => array('category', 'post_tag'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-megaphone',
'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('dich_vu', $args);
}
add_action('init', 'custom_post_type_dichvu', 0);