-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcustomizer-archive-section.php
138 lines (124 loc) · 3.35 KB
/
customizer-archive-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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?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_archive_section( $wp_customize ) {
$wp_customize->add_section(
'smntcs_retro_theme_archive_section',
array(
'title' => __( 'Archives', 'smntcs-retro' ),
'panel' => 'smntcs_retro_theme_options_section',
)
);
$wp_customize->add_setting(
'smntcs_retro_archive_show_posts_as',
array(
'sanitize_callback' => 'smntcs_retro_sanitize_select',
'type' => 'theme_mod',
'default' => 'excerpt',
)
);
$wp_customize->add_control(
'smntcs_retro_archive_show_posts_as',
array(
'label' => __( 'Show post as', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_archive_section',
'type' => 'select',
'choices' => array(
'excerpt' => __( 'Excerpt', 'smntcs-retro' ),
'full' => __( 'Full post', 'smntcs-retro' ),
),
)
);
$wp_customize->add_setting(
'smntcs_retro_archive_show_author',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_archive_show_author',
array(
'label' => __( 'Show author on archive page', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_archive_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_archive_show_date',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_archive_show_date',
array(
'label' => __( 'Show date on archive page', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_archive_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_archive_show_tags',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_archive_show_tags',
array(
'label' => __( 'Show tags on archive page', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_archive_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_archive_show_categories',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_archive_show_categories',
array(
'label' => __( 'Show categories on archive page', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_archive_section',
'type' => 'checkbox',
)
);
$wp_customize->add_setting(
'smntcs_retro_archive_show_more_link',
array(
'default' => true,
'sanitize_callback' => 'smntcs_retro_sanitize_checkbox',
'type' => 'theme_mod',
)
);
$wp_customize->add_control(
'smntcs_retro_archive_show_more_link',
array(
'label' => __( 'Show more link on archive page', 'smntcs-retro' ),
'section' => 'smntcs_retro_theme_archive_section',
'type' => 'checkbox',
)
);
}
add_action( 'customize_register', 'smntcs_retro_theme_archive_section' );