-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.php
510 lines (431 loc) · 18.9 KB
/
options.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
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*/
function optionsframework_option_name() {
global $advertica_shortname;
global $advertica_themename;
// This gets the theme name from the stylesheet
$advertica_themename = get_option( 'stylesheet' );
$advertica_themename = preg_replace("/\W/", "_", strtolower($advertica_themename) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $advertica_themename;
update_option( 'optionsframework', $optionsframework_settings );
}
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the 'id' fields, make sure to use all lowercase and no spaces.
* If you are making your theme translatable, you should replace 'advertica-lite'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
global $advertica_shortname;
global $advertica_themename;
// Background Defaults
$background_style = array(
'color' => '',
'image' => '',
'repeat' => 'repeat',
'position' => 'top center',
'attachment'=>'scroll' );
//breadcumhide_array
$breadcumhide_array = array(
'true' => __('Enable', 'advertica-lite'),
'false' => __('Disable', 'advertica-lite')
);
$bread_type = array(
'brimage' => __('Image', 'advertica-lite'),
'brcolor' => __('Color', 'advertica-lite')
);
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all tags into an array
$options_tags = array();
$options_tags_obj = get_tags();
foreach ( $options_tags_obj as $tag ) {
$options_tags[$tag->term_id] = $tag->name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
// set pages
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
// If using image radio buttons, define a directory path
$imagepath = get_template_directory_uri() . '/images/';
$twitterInfo = 'http://www.sketchthemes.com/tutorials/getting-new-twitter-api-consumer-and-secret-keys/';
$options = array();
//General Settings
$options[] = array(
'name' => __('General Settings', 'advertica-lite'),
'type' => 'heading');
$options[] = array(
'name' => __('Choose Theme Color', 'advertica-lite'),
'desc' => __('', 'advertica-lite'),
'id' => $advertica_shortname.'_colorpicker',
'std' => '#FFA500',
'type' => 'color' );
$options[] = array(
'name' => __('Change Logo (full path to logo image size: width * height (156px * 40px) )', 'advertica-lite'),
'desc' => __('This creates a custom logo for your website.', 'advertica-lite'),
'id' => $advertica_shortname.'_logo_img',
'std' => '',
'type' => 'upload');
$options[] = array(
'name' => __('Logo ALT Text', 'advertica-lite'),
'desc' => __('Enter logo image alt attribute text.', 'advertica-lite'),
'id' => $advertica_shortname.'_logo_alt',
'std' => 'sketch themes',
'type' => 'text');
$options[] = array(
'name' => __('Upload Favicon', 'advertica-lite'),
'desc' => __('This creates a custom favicon for your website.', 'advertica-lite'),
'id' => $advertica_shortname.'_favicon',
'std' => '',
'type' => 'upload');
//Bg style
$options[] = array(
'name' => __('Custom Background', 'advertica-lite'),
'desc' => __('Change the page background.', 'advertica-lite'),
'id' => $advertica_shortname.'_bg_style',
'std' => $background_style,
'type' => 'background' );
//Breadcrumb
$options[] = array(
'name' => __('Breadcrumb Settings', 'advertica-lite'),
'type' => 'heading');
$options[] = array(
'name' => __('Breadcrumb Enable/Disable', 'advertica-lite'),
'desc' => __('', 'advertica-lite'),
'id' => $advertica_shortname.'_hide_bread',
'std' => 'true',
'type' => 'radio',
'options' => $breadcumhide_array);
$options[] = array(
'name' => __('Page Title & Breadcrumb Background Type', 'advertica-lite'),
'desc' => __('', 'advertica-lite'),
'id' => $advertica_shortname.'_bread_stype',
'std' => 'brcolor',
'type' => 'radio',
'options' => $bread_type);
$options[] = array(
'name' => __('Choose Page Title & Breadcrumb Background Color', 'advertica-lite'),
'desc' => __('Please choose background color', 'advertica-lite'),
'id' => $advertica_shortname.'_bread_color',
'std' => '#F9F1E3',
'type' => 'color',
'class'=>'hidden' );
$options[] = array(
'name' => __('Upload Page Title & Breadcrumb Background Image ( width * height (1600px * 180px) )', 'advertica-lite'),
'desc' => __('This image will show up as background on page title & breadcrumb section.', 'advertica-lite'),
'id' => $advertica_shortname.'_bread_image',
'std' => $imagepath.'page-title-bg.jpg',
'type' => 'upload',
'class'=>'hidden');
$options[] = array(
'name' => __('Choose Page Title & Breadcrumb Font Color', 'advertica-lite'),
'desc' => __('Please choose font color', 'advertica-lite'),
'id' => $advertica_shortname.'_bread_title_color',
'std' => '#222222',
'type' => 'color' );
//Blog
$options[] = array(
'name' => __('Blog Page Settings', 'advertica-lite'),
'type' => 'heading');
//Blog page Title
$options[] = array(
'name' => __('Enter Blog Page Title', 'advertica-lite'),
'desc' => __('Enter blog page title text.', 'advertica-lite'),
'id' => $advertica_shortname.'_blogpage_heading',
'std' => 'Blog',
'type' => 'text');
//Home Page Featured Box Options
$options[] = array(
'name' => __('Home Featured Section', 'advertica-lite'),
'type' => 'heading');
$options[] = array(
'name' => __('Home page Image:', 'advertica-lite'),
'desc' => __('Choose image for home page. Size: Width 1600px and Height 500px.', 'advertica-lite'),
'id' => $advertica_shortname.'_frontslider_stype',
'std' => $imagepath.'advertica-header.png',
'type' => 'upload');
//Featured Box 1
$options[] = array(
'name' => __('First Featured Box Heading', 'advertica-lite'),
'desc' => __('Enter heading for first featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb1_first_part_heading',
'std' => 'Business Strategy',
'type' => 'text');
$options[] = array(
'name' => __('First Featured Box Image Path (size: width * height (150px * 150px) )', 'advertica-lite'),
'desc' => __('Upload image for first featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb1_first_part_image',
'std' => '',
'type' => 'upload');
$options[] = array(
'name' => __('First Featured Box Content', 'advertica-lite'),
'desc' => __('Enter content for first featured box.','advertica-lite'),
'id' => $advertica_shortname.'_fb1_first_part_content',
'std' => ' Get focused from your target consumers and increase your business with Web portal Design and Development. ',
'type' => 'textarea');
$options[] = array(
'name' => __('First Featured Box Link', 'advertica-lite'),
'desc' => __('Enter link for first featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb1_first_part_link',
'std' => '#',
'type' => 'text');
//Featured Box 2
$options[] = array(
'name' => __('Second Featured Box Heading', 'advertica-lite'),
'desc' => __('Enter heading for second featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb2_second_part_heading',
'std' => 'Quality Products',
'type' => 'text');
$options[] = array(
'name' => __('Second Featured Box Image Path (size: width * height (150px * 150px) )', 'advertica-lite'),
'desc' => __('Upload image for second featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb2_second_part_image',
'std' => '',
'type' => 'upload');
$options[] = array(
'name' => __('Second Featured Box Content', 'advertica-lite'),
'desc' => __('Enter content for second featured box.','advertica-lite'),
'id' => $advertica_shortname.'_fb2_second_part_content',
'std' => ' Products with the ultimate features and functionality that provide the complete satisfaction to the clients.',
'type' => 'textarea');
$options[] = array(
'name' => __('Second Featured Box Link', 'advertica-lite'),
'desc' => __('Enter link for second featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb2_second_part_link',
'std' => '#',
'type' => 'text');
//Featured Box 3
$options[] = array(
'name' => __('Third Featured Box Heading', 'advertica-lite'),
'desc' => __('Enter heading for third featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb3_third_part_heading',
'std' => 'Best Business Plans',
'type' => 'text');
$options[] = array(
'name' => __('Third Featured Box Image Path (size: width * height (150px * 150px) )', 'advertica-lite'),
'desc' => __('Upload image for third featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb3_third_part_image',
'std' => '',
'type' => 'upload');
$options[] = array(
'name' => __('Third Featured Box Content', 'advertica-lite'),
'desc' => __('Enter content for third featured box.','advertica-lite'),
'id' => $advertica_shortname.'_fb3_third_part_content',
'std' => ' Based on the client requirement, different business plans suits and fulfill your business and cost requirement.',
'type' => 'textarea');
$options[] = array(
'name' => __('Third Featured Box Link', 'advertica-lite'),
'desc' => __('Enter link for third featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb3_third_part_link',
'std' => '#',
'type' => 'text');
//Featured Box 4
$options[] = array(
'name' => __('Fourth Featured Box Heading', 'advertica-lite'),
'desc' => __('Enter heading for fourth featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb4_second_part_heading',
'std' => 'Quality Products',
'type' => 'text');
$options[] = array(
'name' => __('Fourth Featured Box Image Path (size: width * height (150px * 150px) )', 'advertica-lite'),
'desc' => __('Upload image for fourth featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb4_second_part_image',
'std' => '',
'type' => 'upload');
$options[] = array(
'name' => __('Fourth Featured Box Content', 'advertica-lite'),
'desc' => __('Enter content for fourth featured box.','advertica-lite'),
'id' => $advertica_shortname.'_fb4_second_part_content',
'std' => ' Products with the ultimate features and functionality that provide the complete satisfaction to the clients.',
'type' => 'textarea');
$options[] = array(
'name' => __('Fourth Featured Box Link', 'advertica-lite'),
'desc' => __('Enter link for fourth featured box.', 'advertica-lite'),
'id' => $advertica_shortname.'_fb4_second_part_link',
'std' => '#',
'type' => 'text');
//Front Page Parallax Box Options
$options[] = array(
'name' => __('Home Parallax Section', 'advertica-lite'),
'type' => 'heading');
$options[] = array(
'name' => __('Parallax Section Background Image (size: width * height (1600x * 1000px) )', 'advertica-lite'),
'desc' => __('Upload background image for parallax section.', 'advertica-lite'),
'id' => $advertica_shortname.'_fullparallax_image',
'std' => $imagepath.'Parallax_Section_Image.jpg',
'type' => 'upload');
$options[] = array(
'name' => __('Parallax Section Content', 'advertica-lite'),
'desc' => __('Enter content for parallax section','advertica-lite'),
'id' => $advertica_shortname.'_para_content_left',
'std' => '<div class="skt-awesome-section">
<div class="skt-awesome-title">Awesome Parallax Section</div><div class="skt-awesome-desp">Advertica features an amazing parallax section</div>
</div>',
'type' => 'textarea');
//Front Page Options
$options[] = array(
'name' => __('Home Clients Logo Section', 'advertica-lite'),
'type' => 'heading');
$options[] = array(
'name' => __('Client Section Title', 'advertica-lite'),
'desc' => __('Enter title for client section.', 'advertica-lite'),
'id' => $advertica_shortname.'_clientsec_title',
'std' => 'Our Partners',
'type' => 'text');
$options[] = array(
'name' => __('First Client Logo Title', 'advertica-lite'),
'desc' => __('Enter title for first client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img1_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('First Client Logo Image (size: width * height (232px * 101px)', 'advertica-lite'),
'desc' => __('Upload image for first client logo.', 'advertica-lite'),
'id' => $advertica_shortname.'_img1_icon',
'std' => $imagepath.'clients-logo/defdault-client-logo.png',
'type' => 'upload');
$options[] = array(
'name' => __('First Client Logo Image Link', 'advertica-lite'),
'desc' => __('Enter link for first client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img1_link',
'std' => '#',
'type' => 'text');
$options[] = array(
'name' => __('Second Client Logo Title', 'advertica-lite'),
'desc' => __('Enter title for second client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img2_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Second Client Logo Image (size: width * height (232px * 101px)', 'advertica-lite'),
'desc' => __('Upload image for second client logo.', 'advertica-lite'),
'id' => $advertica_shortname.'_img2_icon',
'std' => $imagepath.'clients-logo/defdault-client-logo.png',
'type' => 'upload');
$options[] = array(
'name' => __('Second Client Logo Image Link', 'advertica-lite'),
'desc' => __('Enter link for second client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img2_link',
'std' => '#',
'type' => 'text');
$options[] = array(
'name' => __('Third Client Logo Title', 'advertica-lite'),
'desc' => __('Enter title for third client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img3_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Third Client Logo Image (size: width * height (232px * 101px)', 'advertica-lite'),
'desc' => __('Upload image for third client logo.', 'advertica-lite'),
'id' => $advertica_shortname.'_img3_icon',
'std' => $imagepath.'clients-logo/defdault-client-logo.png',
'type' => 'upload');
$options[] = array(
'name' => __('Third Client Logo Image Link', 'advertica-lite'),
'desc' => __('Enter link for third client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img3_link',
'std' => '#',
'type' => 'text');
$options[] = array(
'name' => __('Fourth Client Logo Title', 'advertica-lite'),
'desc' => __('Enter title for fourth client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img4_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Fourth Client Logo Image (size: width * height (232px * 101px)', 'advertica-lite'),
'desc' => __('Upload image for fourth client logo.', 'advertica-lite'),
'id' => $advertica_shortname.'_img4_icon',
'std' => $imagepath.'clients-logo/defdault-client-logo.png',
'type' => 'upload');
$options[] = array(
'name' => __('Fourth Client Logo Image Link', 'advertica-lite'),
'desc' => __('Enter link for fourth client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img4_link',
'std' => '#',
'type' => 'text');
$options[] = array(
'name' => __('Fifth Client Logo Title', 'advertica-lite'),
'desc' => __('Enter title for fifth client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img5_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Fifth Client Logo Image (size: width * height (232px * 101px)', 'advertica-lite'),
'desc' => __('Upload image for fifth client logo.', 'advertica-lite'),
'id' => $advertica_shortname.'_img5_icon',
'std' => $imagepath.'clients-logo/defdault-client-logo.png',
'type' => 'upload');
$options[] = array(
'name' => __('Fifth Client Logo Image Link', 'advertica-lite'),
'desc' => __('Enter link for fifth client logo image.', 'advertica-lite'),
'id' => $advertica_shortname.'_img5_link',
'std' => '#',
'type' => 'text');
//Footer
$options[] = array(
'name' => __('Footer Settings', 'advertica-lite'),
'type' => 'heading');
$options[] = array(
'name' => __('Copyright Text', 'advertica-lite'),
'desc' => __('Enter text for copyright (you can also use HTML tags here).', 'advertica-lite'),
'id' => $advertica_shortname.'_copyright',
'std' => "Copyright Text",
'type' => 'textarea');
return $options;
}
/*
* This is an example of how to add custom scripts to the options panel.
* This example shows/hides an option when a checkbox is clicked.
*/
add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
function optionsframework_custom_scripts() { ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#example_showhidden').click(function() {
$('#section-example_text_hidden').fadeToggle(400);
});
if ($('#example_showhidden:checked').val() !== undefined) {
$('#section-example_text_hidden').show();
}
var selected_bredbtn = jQuery("#section-advertica_bread_stype input:checked").val();
if (selected_bredbtn === 'brcolor') {
jQuery('#section-advertica_bread_color').show();
}
else if (selected_bredbtn === 'brimage') {
jQuery('#section-advertica_bread_image').show();
}
jQuery("input[type='radio']").change(function() {
var selected_radio = jQuery(this).val();
if (selected_radio === 'brcolor') {
jQuery('#section-advertica_bread_image').hide();
jQuery('#section-advertica_bread_color').fadeIn();
}else if (selected_radio === 'brimage') {
jQuery('#section-advertica_bread_color').hide();
jQuery('#section-advertica_bread_image').fadeIn();
}
});
});
</script>
<?php
}