-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
141 lines (99 loc) · 4.52 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
<?php
/* ========================================================================================================================
Images
- Set thumbnail sizes and add any additional featured images.
======================================================================================================================== */
add_theme_support('post-thumbnails');
add_image_size('cartogram_small',400, 400, true);
add_image_size('cartogram_rectangle',600, 400, false);
add_image_size('cartogram_medium',750, 750, true);
add_image_size('cartogram_large',1500, 1500, true);
add_image_size('img-small',300, 200, true);
add_image_size('img-logo',250, 250, false);
add_image_size('img-featured',1500, 500, true);
/* ========================================================================================================================
Navigation Menus
======================================================================================================================== */
register_nav_menus( array(
'nav_primary' => 'Primary Nav',
'nav_artists' => 'Artists Sub Nav',
'nav_programs' => 'Programs Sub Nav',
'nav_about' => 'About Sub Nav',
'nav_get_involved' => 'Get Involved Sub Nav',
'nav_secondary' => 'Secondary Sub Nav below the main links in the side panel'
) );
/* ========================================================================================================================
Define Widgetized Areas
======================================================================================================================== */
register_sidebar(array(
'name' => 'Sidebar',
'id' => 'sidebar',
'description' => __('This is the default widget area for the sidebar. This will be displayed if the other sidebars have not been populated with widgets.', 'cartogram'),
'before_widget' => '<div id="%1$s" class="widget">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
/* ========================================================================================================================
Cartogram Post Types and Taxonomies Functions v.1.0
======================================================================================================================== */
function create_post_types() {
$testimonialsLabels = array(
'name' => __( 'Testimonials' ),
'singular_name' => __( 'Testimonials' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __( 'Add New Testimonial' ),
'edit' => __( 'Edit' ),
'edit_item' => __( 'Edit Testimonial' ),
'new_item' => __( 'New Testimonial' ),
'view' => __( 'View Testimonials' ),
'view_item' => __( 'View Testimonial' ),
'search_items' => __( 'Search Testimonials' ),
'not_found' => __( 'No Testimonials found' ),
'not_found_in_trash' => __( 'No Testimonials found in Trash' ),
'parent' => __( 'Parent Testimonial' ),
);
$testimonialsArgs = array(
'labels' => $testimonialsLabels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'has_archive' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'taxonomies' => array(''),
'menu_position' => null,
'supports' => array('title', 'editor', 'thumbnail')
);
register_post_type( 'testimonials' , $testimonialsArgs );
flush_rewrite_rules( false );
}
function create_taxonomies() {
$labels = array(
'name' => __( 'Product' ),
'singular_name' => __( 'Product' ),
'search_items' => __( 'Search Products' ),
'all_items' => __( 'All Products' ),
'parent_item' => __( 'Parent Product' ),
'parent_item_colon' => __( 'Parent Product:' ),
'edit_item' => __( 'Edit Product' ),
'update_item' => __( 'Update Product' ),
'add_new_item' => __( 'Add New Product' ),
'new_item_name' => __( 'New Product Name' )
);
register_taxonomy('product',array( 'faq', 'manuals', 'tutorials', 'diagrams', 'warranties', 'videos',),array(
'hierarchical' => true,
'labels' => $labels
));
flush_rewrite_rules( false );
}
/* ========================================================================================================================
Add Fonts to Head
======================================================================================================================== */
function load_fonts() {
echo "<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Lato:400,400italic' rel='stylesheet' type='text/css'>";
}
add_action('wp_print_styles', 'load_fonts');
?>