-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
104 lines (94 loc) · 3.59 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
<?php
function africahacktrip_customize_register($wp_customize){
$wp_customize->add_section('africahacktrip_logo_section', array(
'title' => __('Logo', 'africahacktrip'),
'priority' => 120,
'description' => 'Upload a logo to replace the default site name and description in the header',
));
// =============================
// = Image Upload =
// =============================
$wp_customize->add_setting('africahacktrip_logo');
$wp_customize->add_control( new WP_Customize_Image_Control($wp_customize, 'africahacktrip_logo', array(
'label' => __('Logo', 'africahacktrip'),
'section' => 'africahacktrip_logo_section',
'settings' => 'africahacktrip_logo',
)));
}
add_action('customize_register', 'africahacktrip_customize_register');
function create_post_types() {
register_post_type( 'person',
array(
'labels' => array(
'name' => __( 'People' ),
'singular_name' => __( 'Person' )
),
'public' => true,
'taxonomies' => array("category"),
'supports' => array('thumbnail', 'excerpt', 'title', 'editor', 'custom-fields'),
'exclude_from_search' => true,
'rewrite' => array('slug' => 'people'),
)
);
register_post_type( 'space',
array(
'labels' => array(
'name' => __( 'Space' ),
'singular_name' => __( 'Spaces' )
),
'public' => true,
'taxonomies' => array("category"),
'supports' => array('thumbnail', 'excerpt', 'title', 'editor', 'custom-fields'),
'exclude_from_search' => true,
'rewrite' => array('slug' => 'spaces'),
)
);
register_post_type( 'tile',
array(
'labels' => array(
'name' => 'Tile',
'singular_name' => 'Tiles'
),
'public' => true,
'supports' => array('thumbnail', 'excerpt', 'title', 'editor', 'custom-fields'),
'exclude_from_search' => true,
'rewrite' => array('slug' => 'tiles'),
)
);
}
add_action( 'init', 'create_post_types' );
function add_people_thumbnail_size() {
add_image_size('person_thumbnail', 157, 157, true);
}
add_action('init', 'add_people_thumbnail_size');
/**
*
* Overwritten to remove the tags
*
* Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
*
* Create your own twentythirteen_entry_meta() to override in a child theme.
*
* @since Twenty Thirteen 1.0
*
* @return void
*/
function twentythirteen_entry_meta() {
if ( is_sticky() && is_home() && ! is_paged() )
echo '<span class="featured-post">' . __( 'Sticky', 'twentythirteen' ) . '</span>';
if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
twentythirteen_entry_date();
// Translators: used between list items, there is a space after the comma.
$categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
if ( $categories_list ) {
echo '<span class="categories-links">' . $categories_list . '</span>';
}
// Post author
if ( 'post' == get_post_type() ) {
printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ),
get_the_author()
);
}
}