-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcustomizer-post-section.php
116 lines (104 loc) · 2.71 KB
/
customizer-post-section.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
<?php
/**
* Initialize WordPress customizer.
*
* @package WordPress
* @subpackage SMNTCS_Retro
*/
/**
* Add theme options to the WordPress customizer
*
* @since 1.6.0
* @param WP_Customize_Manager $wp_customize The customizer object.
* @return void
*/
function smntcs_retro_theme_post_section( $wp_customize ) {
$wp_customize->add_section(
'smntcs_retro_theme_post_section',
array(
'title' => __( 'Posts', 'smntcs-retro' ),
'panel' => 'smntcs_retro_theme_options_section',
)
);
$wp_customize->add_setting(
'smntcs_retro_post_show_author',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_post_show_author',
array(
'label' => __( 'Show author on posts', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_post_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_post_show_date',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_post_show_date',
array(
'label' => __( 'Show date on posts', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_post_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_post_show_tags',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_post_show_tags',
array(
'label' => __( 'Show tags on posts', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_post_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_post_show_categories',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_post_show_categories',
array(
'label' => __( 'Show categories on posts', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_post_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_show_post_pagination',
array(
'default' => false,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_show_post_pagination',
array(
'label' => __( 'Show pagination on post pages', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_post_section',
'type' => 'checkbox',
)
);
}
add_action( 'customize_register', 'smntcs_retro_theme_post_section' );