-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoder-options.php
More file actions
232 lines (198 loc) · 5.87 KB
/
coder-options.php
File metadata and controls
232 lines (198 loc) · 5.87 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<?php
/*
Options for the Customizer of Coder Theme.
Created by Omar De La Hoz (omar.dlhz@hotmail.com) on 06/06/16
Available on Github (https://github.com/omardlhz/codertheme/)
*/
function header_info($wp_customize){
$wp_customize->add_section("info", array(
"title" => __("Header Information", "coder_header_sections"),
"priority" => 30,
));
$wp_customize->add_setting("header_title", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"header_title",
array(
"label" => __("Header Title", "customizer_header_title_label"),
"description" => "Displayed bellow profile image. (Site title will be used if left empty)",
"section" => "info",
"settings" => "header_title",
"type" => "text",
)
));
$wp_customize->add_setting("header_caption", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"header_caption",
array(
"label" => __("Header Caption", "customizer_header_title_label"),
"description" => "Displayed bellow Header title. (Tagline will be used if left empty)",
"section" => "info",
"settings" => "header_caption",
"type" => "text",
)
));
$wp_customize->add_setting("profile_image", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Image_Control(
$wp_customize,
"profile_image",
array(
"label" => __( "Profile Image", 'customizer_header_title_label' ),
"description" => "Displayed above Header title. (Placeholder image will be used if left empty)",
"section" => "info",
"settings" => "profile_image",
)
));
$wp_customize->add_setting("cover_image", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Image_Control(
$wp_customize,
"cover_image",
array(
"label" => __( "Cover Image", 'customizer_header_title_label' ),
"description" => "Displayed behind profile image. (Recommended size 890x210)",
"section" => "info",
"settings" => "cover_image",
)
));
$wp_customize->add_section("links", array(
"title" => __("Header Links", "coder_header_sections"),
"priority" => 30,
));
$wp_customize->add_setting("about_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"about_link",
array(
"label" => __("About Link", "customizer_header_title_label"),
"description" => "Link to your About page.",
"section" => "links",
"settings" => "about_link",
"type" => "text",
)
));
$wp_customize->add_setting("github_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"github_link",
array(
"label" => __("Github Link", "customizer_header_title_label"),
"description" => "Link to your Github profile.",
"section" => "links",
"settings" => "github_link",
"type" => "text",
)
));
$wp_customize->add_setting("resume_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Upload_Control(
$wp_customize,
'resume_link',
array(
"label" => __( 'Resume Link', "customizer_header_title_label" ),
"section" => "links",
"description" => "Upload your resume file.",
"settings" => "resume_link",
)
));
$wp_customize->add_setting("linkedin_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"linkedin_link",
array(
"label" => __("LinkedIn Link", "customizer_header_title_label"),
"description" => "Link to your LinkedIn profile.",
"section" => "links",
"settings" => "linkedin_link",
"type" => "text",
)
));
$wp_customize->add_setting("custom1name_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"custom1name_link",
array(
"label" => __("Custom Link #1 Name", "customizer_header_title_label"),
"description" => "Name of Custom Link #1",
"section" => "links",
"settings" => "custom1name_link",
"type" => "text",
)
));
$wp_customize->add_setting("custom1_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"custom1_link",
array(
"label" => __("Custom Link #1", "customizer_header_title_label"),
"section" => "links",
"settings" => "custom1_link",
"type" => "text",
)
));
$wp_customize->add_setting("custom2name_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"custom2name_link",
array(
"label" => __("Custom Link #2 Name", "customizer_header_title_label"),
"description" => "Name of Custom Link #2",
"section" => "links",
"settings" => "custom2name_link",
"type" => "text",
)
));
$wp_customize->add_setting("custom2_link", array(
"default" => "",
"transport" => "postMessage",
));
$wp_customize->add_control(new WP_Customize_Control(
$wp_customize,
"custom2_link",
array(
"label" => __("Custom Link #2", "customizer_header_title_label"),
"section" => "links",
"settings" => "custom2_link",
"type" => "text",
)
));
}
add_action("customize_register","header_info");
function codertheme_live_preview()
{
wp_enqueue_script("codertheme_customizer", get_template_directory_uri() . "/coder-livepreview.js", array("jquery", "customize-preview"), '', true);
}
add_action("customize_preview_init", "codertheme_live_preview");
?>