-
Notifications
You must be signed in to change notification settings - Fork 0
/
customizer.php
executable file
·1236 lines (1069 loc) · 36 KB
/
customizer.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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
class Maera_BS_Customizer {
function __construct() {
add_action( 'customize_register', array( $this, 'customizer_sections' ) );
add_filter( 'kirki/controls', array( $this, 'settings_advanced' ) );
add_filter( 'kirki/controls', array( $this, 'settings_layout' ) );
add_filter( 'kirki/controls', array( $this, 'settings_layout_advanced' ) );
add_filter( 'kirki/controls', array( $this, 'settings_nav' ) );
add_filter( 'kirki/controls', array( $this, 'settings_nav_bg' ) );
add_filter( 'kirki/controls', array( $this, 'settings_typo_nav' ) );
add_filter( 'kirki/controls', array( $this, 'settings_colors' ) );
add_filter( 'kirki/controls', array( $this, 'settings_html_bg' ) );
add_filter( 'kirki/controls', array( $this, 'settings_body_bg' ) );
add_filter( 'kirki/controls', array( $this, 'settings_typo_base' ) );
add_filter( 'kirki/controls', array( $this, 'settings_typo_headers' ) );
add_filter( 'kirki/controls', array( $this, 'settings_blog_options' ) );
add_filter( 'kirki/controls', array( $this, 'settings_feat_archive' ) );
add_filter( 'kirki/controls', array( $this, 'settings_feat_single' ) );
if ( is_active_sidebar('jumbotron') ) {
add_filter( 'kirki/controls', array( $this, 'settings_jumbo_bg' ) );
add_filter( 'kirki/controls', array( $this, 'settings_structure_jumbo' ) );
add_filter( 'kirki/controls', array( $this, 'settings_typo_jumbo' ) );
}
if ( is_active_sidebar('header') ) {
add_filter( 'kirki/controls', array( $this, 'settings_header_bg' ) );
}
add_filter( 'kirki/controls', array( $this, 'settings_social' ) );
add_filter( 'kirki/controls', array( $this, 'settings_footer_bg' ) );
add_filter( 'kirki/controls', array( $this, 'settings_branding' ) );
add_filter( 'kirki/controls', array( $this, 'settings_general' ) );
}
function layouts() {
$layouts = array(
0 => get_template_directory_uri() . '/assets/images/1c.png',
1 => get_template_directory_uri() . '/assets/images/2cr.png',
2 => get_template_directory_uri() . '/assets/images/2cl.png',
3 => get_template_directory_uri() . '/assets/images/3cl.png',
4 => get_template_directory_uri() . '/assets/images/3cr.png',
5 => get_template_directory_uri() . '/assets/images/3cm.png',
);
return $layouts;
}
/*
* Create the sections
*/
function customizer_sections( $wp_customize ) {
$panels = array(
'structure' => array( 'title' => __( 'Structure', 'maera_bs' ), 'description' => __( 'Set the structure options', 'maera_bs' ), 'priority' => 10 ),
'backgrounds' => array( 'title' => __( 'Backgrounds', 'maera_bs' ), 'description' => __( 'Set the site backgrounds', 'maera_bs' ), 'priority' => 20 ),
'typography' => array( 'title' => __( 'Typography', 'maera_bs' ), 'description' => __( 'Set the site typography options', 'maera_bs' ), 'priority' => 30 ),
'blog' => array( 'title' => __( 'Blog', 'maera_bs' ), 'description' => __( 'Set the blog options', 'maera_bs' ), 'priority' => 40 ),
);
$sections = array(
'branding' => array( 'title' => __( 'Branding', 'maera_bs' ), 'priority' => 5, 'panel' => '' ),
'nav' => array( 'title' => __( 'Navigation', 'maera_bs' ), 'priority' => 10, 'panel' => '' ),
'general' => array( 'title' => __( 'General', 'maera_bs' ), 'priority' => 10, 'panel' => 'structure' ),
'layout' => array( 'title' => __( 'Layout', 'maera_bs' ), 'priority' => 15, 'panel' => 'structure' ),
'layout_advanced' => array( 'title' => __( 'Advanced Layout', 'maera_bs' ), 'priority' => 20, 'panel' => 'structure' ),
'structure_jumbo' => array( 'title' => __( 'Jumbotron', 'maera_bs' ), 'priority' => 30, 'panel' => 'structure' ),
'html_bg' => array( 'title' => __( 'HTML', 'maera_bs' ), 'priority' => 10, 'panel' => 'backgrounds' ),
'body_bg' => array( 'title' => __( 'Body', 'maera_bs' ), 'priority' => 15, 'panel' => 'backgrounds' ),
'nav_bg' => array( 'title' => __( 'Navbar', 'maera_bs' ), 'priority' => 20, 'panel' => 'backgrounds' ),
'header_bg' => array( 'title' => __( 'Extra Header', 'maera_bs' ), 'priority' => 25, 'panel' => 'backgrounds' ),
'jumbo_bg' => array( 'title' => __( 'Jumbotron', 'maera_bs' ), 'priority' => 30, 'panel' => 'backgrounds' ),
'footer_bg' => array( 'title' => __( 'Footer', 'maera_bs' ), 'priority' => 35, 'panel' => 'backgrounds' ),
'colors' => array( 'title' => __( 'Colors', 'maera_bs' ), 'priority' => 25, 'panel' => '' ),
'typo_base' => array( 'title' => __( 'Base', 'maera_bs' ), 'priority' => 10, 'panel' => 'typography' ),
'typo_headers' => array( 'title' => __( 'Headers', 'maera_bs' ), 'priority' => 15, 'panel' => 'typography' ),
'typo_nav' => array( 'title' => __( 'Navbar', 'maera_bs' ), 'priority' => 20, 'panel' => 'typography' ),
'typo_header' => array( 'title' => __( 'Extra Header', 'maera_bs' ), 'priority' => 25, 'panel' => 'typography' ),
'typo_jumbo' => array( 'title' => __( 'Jumbotron', 'maera_bs' ), 'priority' => 30, 'panel' => 'typography' ),
'typo_footer' => array( 'title' => __( 'Footer', 'maera_bs' ), 'priority' => 35, 'panel' => 'typography' ),
'blog_options' => array( 'title' => __( 'Blog Options', 'maera_bs' ), 'priority' => 10, 'panel' => 'blog' ),
'feat_archive' => array( 'title' => __( 'Featured Images on archives', 'maera_bs' ), 'priority' => 15, 'panel' => 'blog' ),
'feat_single' => array( 'title' => __( 'Featured Images on posts', 'maera_bs' ), 'priority' => 20, 'panel' => 'blog' ),
'social' => array( 'title' => __( 'Social Links', 'maera_bs' ), 'priority' => 45, 'panel' => '' ),
'advanced' => array( 'title' => __( 'Advanced', 'maera_bs' ), 'priority' => 50, 'panel' => '' ),
'custom_widget_areas' => array( 'title' => __( 'Custom Widget Areas', 'maera_bs' ), 'priority' => 55, 'panel' => '' ),
);
foreach ( $sections as $section => $args ) {
$wp_customize->add_section( $section, array(
'title' => $args['title'],
'priority' => $args['priority'],
'panel' => $args['panel']
) );
}
foreach ( $panels as $panel => $args ) {
$wp_customize->add_panel( $panel, array(
'priority' => $args['priority'],
'capability' => 'edit_theme_options',
'theme_supports' => '',
'title' => $args['title'],
'description' => $args['description']
) );
}
}
function settings_advanced( $controls ) {
$controls[] = array(
'type' => 'code',
'settings' => 'css',
'label' => __( 'Custom CSS', 'maera_bs' ),
'subtitle' => __( 'You can write your custom CSS here. This code will appear in a script tag appended in the header section of the page.', 'maera_bs' ),
'section' => 'advanced',
'priority' => 4,
'default' => '',
'choices' => array(
'language' => 'css',
'theme' => 'monokai',
'height' => 250,
)
);
$controls[] = array(
'type' => 'code',
'settings' => 'less',
'label' => __( 'Custom LESS', 'maera_bs' ),
'subtitle' => __( 'You can write your custom LESS here. This code will be compiled with the other LESS files of the theme and be appended to the header.', 'maera_bs' ),
'section' => 'advanced',
'priority' => 5,
'default' => '',
'choices' => array(
'language' => 'less',
'theme' => 'monokai',
'height' => 250,
)
);
$controls[] = array(
'type' => 'code',
'settings' => 'js',
'label' => __( 'Custom JS', 'maera_bs' ),
'subtitle' => __( 'You can write your custom JavaScript/jQuery here. The code will be included in a script tag appended to the bottom of the page.', 'maera_bs' ),
'section' => 'advanced',
'priority' => 6,
'default' => '',
'choices' => array(
'language' => 'javascript',
'theme' => 'monokai',
'height' => 250,
)
);
$controls[] = array(
'type' => 'checkbox',
'settings' => 'minimize_css',
'label' => __( 'Minimize CSS', 'maera_bs' ),
'description' => __( 'Minimize the generated CSS. This should be always be checked for production sites.', 'maera_bs' ),
'section' => 'advanced',
'priority' => 10,
'default' => 1,
);
return $controls;
}
function settings_layout( $controls ) {
$controls[] = array(
'type' => 'radio-buttonset',
'settings' => 'site_style',
'label' => __( 'Site Style', 'maera_bs' ),
'subtitle' => __( 'Wide and boxed Layouts are responsive while fluid layouts are full-width.', 'maera_bs' ),
'section' => 'layout',
'priority' => 2,
'default' => 'wide',
'choices' => array(
'wide' => __( 'Wide', 'maera_bs' ),
'boxed' => __( 'Boxed', 'maera_bs' ),
'fluid' => __( 'Fluid', 'maera_bs' ),
),
);
$controls[] = array(
'type' => 'radio-image',
'settings' => 'layout',
'label' => __( 'Layout', 'maera_bs' ),
'subtitle' => __( 'Select your main layout. Please note that if no widgets are present in a sidebar then that sidebar will not be displayed. ', 'maera_bs' ),
'section' => 'layout',
'priority' => 3,
'default' => 1,
'choices' => $this->layouts(),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'layout_primary_width',
'label' => __( 'Primary Sidebar Width', 'maera_bs' ),
'description' => '',
'section' => 'layout',
'priority' => 4,
'default' => 4,
'choices' => array(
'min' => 1,
'max' => 5,
'step' => 1,
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'layout_secondary_width',
'label' => __( 'Secondary Sidebar Width', 'maera_bs' ),
'description' => '',
'section' => 'layout',
'priority' => 5,
'default' => 3,
'choices' => array(
'min' => 1,
'max' => 5,
'step' => 1,
),
);
return $controls;
}
function settings_layout_advanced( $controls ) {
$controls[] = array(
'type' => 'radio-buttonset',
'settings' => 'widgets_mode',
'label' => __( 'Widgets mode', 'maera_bs' ),
'subtitle' => __( 'How do you want your widgets to be displayed?', 'maera_bs' ),
'section' => 'layout_advanced',
'priority' => 13,
'default' => 2,
'choices' => array(
'none' => __( 'None', 'maera_bs' ),
'well' => __( 'Well', 'maera_bs' ),
'panel' => __( 'Panel', 'maera_bs' ),
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'screen_tablet',
'label' => __( 'Small Screen / Tablet view', 'maera_bs' ),
'subtitle' => __( 'The width of Tablet screens. Default: 768px', 'maera_bs' ),
'section' => 'layout_advanced',
'priority' => 81,
'default' => 768,
'choices' => array(
'min' => 620,
'max' => 2100,
'step' => 1
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'screen_desktop',
'label' => __( 'Desktop Container Width', 'maera_bs' ),
'subtitle' => __( 'The width of normal screens. Default: 992px', 'maera_bs' ),
'section' => 'layout_advanced',
'priority' => 82,
'default' => 992,
'choices' => array(
'min' => 620,
'max' => 2100,
'step' => 1,
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'screen_large_desktop',
'label' => __( 'Large Desktop Container Width', 'maera_bs' ),
'subtitle' => __( 'The width of Large Desktop screens. Default: 1200px', 'maera_bs' ),
'section' => 'layout_advanced',
'priority' => 83,
'default' => 1200,
'choices' => array(
'min' => 620,
'max' => 2100,
'step' => 1,
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'gutter',
'label' => __( 'Gutter', 'maera_bs' ),
'subtitle' => __( 'The spacing between grid columns. Default: 30px', 'maera_bs' ),
'section' => 'layout_advanced',
'priority' => 84,
'default' => 30,
'choices' => array(
'min' => 0,
'max' => 80,
'step' => 1,
),
);
$controls[] = array(
'type' => 'checkbox',
'settings' => 'cpt_layout_toggle',
'label' => __( 'Per Post-Type layouts', 'maera_bs' ),
'subtitle' => __( 'After you enable this setting you will have to save your settings and refresh your page in order to see the new options.', 'maera_bs' ),
'section' => 'layout_advanced',
'priority' => 90,
'default' => 0,
);
if ( 1 == get_theme_mod( 'cpt_layout_toggle', 0 ) ) {
$post_types = get_post_types( array( 'public' => true ), 'names' );
$layout = get_theme_mod( 'layout', 1 );
foreach ( $post_types as $post_type ) {
$controls[] = array(
'type' => 'radio-image',
'settings' => $post_type . '_layout',
'label' => $post_type . ' ' . __( 'layout', 'maera_bs' ),
'description' => null,
'section' => 'layout_advanced',
'priority' => 92,
'default' => $layout,
'choices' => $this->layouts(),
);
}
}
return $controls;
}
function settings_nav( $controls ) {
$controls[] = array(
'type' => 'select',
'settings' => 'navbar_position',
'label' => __( 'NavBar Positioning', 'maera_bs' ),
'description' => __( 'Using this option you can set the navbar to be fixed to top, fixed to bottom or normal. When you\'re using one of the \'fixed\' options, the navbar will stay fixed on the top or bottom of the page. Default: Normal', 'maera_bs' ),
'section' => 'nav',
'default' => 'normal',
'choices' => array(
'normal' => __( 'Normal', 'maera_bs' ),
'full' => __( 'Full-Width', 'maera_bs' ),
'fixed-top' => __( 'Fixed (top)', 'maera_bs' ),
'fixed-bottom' => __( 'Fixed (bottom)', 'maera_bs' ),
'after-headers' => __( 'After Extra Headers', 'maera_bs' ),
'left-slide' => __( 'Left Slide', 'maera_bs' ),
'right-slide' => __( 'Right Slide', 'maera_bs' )
),
'priority' => 23,
);
$controls[] = array(
'type' => 'select',
'settings' => 'grid_float_breakpoint',
'label' => __( 'Responsive NavBar Threshold', 'maera_bs' ),
'subtitle' => __( 'Point at which the navbar becomes uncollapsed', 'maera_bs' ),
'section' => 'nav',
'default' => 'screen_sm_min',
'choices' => array(
'min' => __( 'Never', 'maera_bs' ),
'screen_xs_min' => __( 'Extra Small', 'maera_bs' ),
'screen_sm_min' => __( 'Small', 'maera_bs' ),
'screen_md_min' => __( 'Desktop', 'maera_bs' ),
'screen_lg_min' => __( 'Large Desktop', 'maera_bs' ),
'max' => __( 'Always', 'maera_bs' ),
),
'priority' => 24,
);
$controls[] = array(
'type' => 'checkbox',
'settings' => 'navbar_search',
'label' => __( 'Display search form on the NavBar', 'maera_bs' ),
'section' => 'nav',
'default' => 1,
'priority' => 26,
);
$controls[] = array(
'type' => 'radio-buttonset',
'settings' => 'navbar_nav_align',
'label' => __( 'Menus alignment', 'maera_bs' ),
'section' => 'nav',
'default' => 'left',
'choices' => array(
'left' => __( 'Left', 'maera_bs' ),
'center' => __( 'Center', 'maera_bs' ),
'right' => __( 'Right', 'maera_bs' ),
),
'priority' => 27,
);
$controls[] = array(
'type' => 'slider',
'settings' => 'navbar_height',
'label' => __( 'NavBar Height', 'maera_bs' ),
'subtitle' => __( 'Select the height of your navbars in pixels.', 'maera_bs' ),
'section' => 'nav',
'default' => 50,
'priority' => 33,
'choices' => array(
'min' => 38,
'max' => 200,
'step' => 1,
),
'output' => array(
'element' => '.admin-bar body',
'property' => 'padding-top',
'units' => 'px',
),
);
return $controls;
}
function settings_nav_bg( $controls ) {
$controls[] = array(
'type' => 'color',
'settings' => 'navbar_bg',
'label' => __( 'NavBar Background Color', 'maera_bs' ),
'description' => __( 'Pick a background color for the NavBar. Default: #f8f8f8.', 'maera_bs' ),
'section' => 'nav_bg',
'default' => '#f8f8f8',
'priority' => 30,
);
$controls[] = array(
'type' => 'slider',
'settings' => 'navbar_bg_opacity',
'label' => __( 'NavBar Background Opacity', 'maera_bs' ),
'section' => 'nav_bg',
'default' => 100,
'priority' => 31,
'choices' => array(
'min' => 0,
'max' => 100,
'step' => 1,
),
);
return $controls;
}
function settings_typo_nav( $controls ) {
$controls[] = array(
'type' => 'select',
'settings' => 'font_menus_font_family',
'label' => __( 'Menus font', 'maera_bs' ),
'section' => 'typo_nav',
'default' => 'Helvetica, Arial, sans-serif',
'priority' => 40,
'choices' => Kirki_Fonts::get_font_choices(),
'output' => array(
'element' => '.navbar',
'property' => 'font-family',
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_menus_weight',
'subtitle' => __( 'Font Weight', 'maera_bs' ),
'section' => 'typo_nav',
'default' => 400,
'priority' => 43,
'choices' => array(
'min' => 100,
'max' => 800,
'step' => 100,
),
'output' => array(
'element' => '.navbar',
'property' => 'font-weight',
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_menus_size',
'subtitle' => __( 'Font Size', 'maera_bs' ),
'section' => 'typo_nav',
'default' => 14,
'priority' => 44,
'choices' => array(
'min' => 10,
'max' => 30,
'step' => 1,
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_menus_height',
'subtitle' => __( 'Line Height', 'maera_bs' ),
'section' => 'typo_nav',
'default' => 1.1,
'priority' => 25,
'choices' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
),
'output' => array(
'element' => '.navbar',
'property' => 'line-height',
),
);
return $controls;
}
function settings_colors( $controls ) {
$controls[] = array(
'type' => 'color',
'settings' => 'color_brand_primary',
'label' => __( 'Brand Colors: Primary', 'maera_bs' ),
'description' => __( 'Select your primary branding color. Also referred to as an accent color. This will affect various areas of your site, including the color of your primary buttons, link color, the background of some elements and many more.', 'maera_bs' ),
'section' => 'colors',
'default' => '#428bca',
'priority' => 1,
'shell_var' => '@brand-primary'
);
$controls[] = array(
'type' => 'radio-buttonset',
'settings' => 'gradients_toggle',
'label' => __( 'Enable Gradients', 'maera_bs' ),
'description' => __( 'Enable or disable gradients. These are applied to navbars, buttons and other elements. Please note that gradients will not be applied in the preview mode and can only be seen on the live site.', 'maera_bs' ),
'section' => 'colors',
'priority' => 10,
'default' => 0,
'choices' => array(
0 => __( 'Flat', 'maera_bs' ),
1 => __( 'Gradients', 'maera_bs' ),
),
);
return $controls;
}
function settings_html_bg( $controls ) {
$controls[] = array(
'type' => 'background',
'settings' => 'html_bg',
'label' => __( 'General Background', 'maera_bs' ),
'section' => 'html_bg',
'default' => array(
'color' => '#ffffff',
'image' => null,
'repeat' => 'repeat',
'size' => 'inherit',
'attach' => 'inherit',
'position' => 'left-top',
'opacity' => false,
),
'priority' => 2,
'output' => 'body.bootstrap',
);
return $controls;
}
function settings_body_bg( $controls ) {
$controls[] = array(
'type' => 'color',
'settings' => 'body_bg_color',
'label' => __( 'Background Color', 'maera_bs' ),
'section' => 'body_bg',
'default' => '#ffffff',
'priority' => 31,
);
$controls[] = array(
'type' => 'slider',
'settings' => 'body_bg_opacity',
'label' => __( 'Opacity', 'maera_bs' ),
'section' => 'body_bg',
'default' => 100,
'priority' => 33,
'choices' => array(
'min' => 0,
'max' => 100,
'step' => 1,
)
);
return $controls;
}
function settings_typo_base( $controls ) {
$controls[] = array(
'type' => 'select',
'settings' => 'font_base_family',
'label' => __( 'Base font', 'maera_bs' ),
'section' => 'typo_base',
'default' => 'Helvetica, Arial, sans-serif',
'priority' => 20,
'choices' => Kirki_Fonts::get_font_choices(),
'output' => array(
'element' => 'body',
'property' => 'font-family',
),
);
$controls[] = array(
'type' => 'multicheck',
'settings' => 'font_subsets',
'label' => __( 'Google-Font subsets', 'maera_bs' ),
'description' => __( 'The subsets used from Google\'s API.', 'maera_bs' ),
'section' => 'typo_base',
'default' => 'latin',
'priority' => 22,
'choices' => Kirki_Fonts::get_google_font_subsets(),
'output' => array(
'element' => 'body',
'property' => 'font-subset',
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_base_weight',
'label' => __( 'Base Font Weight', 'maera_bs' ),
'section' => 'typo_base',
'default' => 400,
'priority' => 24,
'choices' => array(
'min' => 100,
'max' => 900,
'step' => 100,
),
'output' => array(
'element' => 'body',
'property' => 'font-weight',
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_base_size',
'label' => __( 'Base Font Size', 'maera_bs' ),
'section' => 'typo_base',
'default' => 14,
'priority' => 25,
'choices' => array(
'min' => 7,
'max' => 48,
'step' => 1,
),
'output' => array(
'element' => 'body',
'property' => 'font-size',
'units' => 'px',
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_base_height',
'label' => __( 'Base Line Height', 'maera_bs' ),
'section' => 'typo_base',
'default' => 1.43,
'priority' => 26,
'choices' => array(
'min' => 0,
'max' => 3,
'step' => 0.01,
),
'output' => array(
'element' => 'body',
'property' => 'line-height',
),
);
return $controls;
}
function settings_typo_headers( $controls ) {
$controls[] = array(
'type' => 'select',
'settings' => 'headers_font_family',
'label' => __( 'Font-Family', 'maera_bs' ),
'section' => 'typo_headers',
'default' => 'Helvetica, Arial, sans-serif',
'priority' => 30,
'choices' => Kirki_Fonts::get_font_choices(),
'output' => array(
'element' => 'h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6',
'property' => 'font-family'
)
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_headers_weight',
'label' => __( 'Font Weight.', 'maera_bs' ) . ' ' . __( 'Default: ', 'maera_bs' ) . 400,
'section' => 'typo_headers',
'default' => 400,
'priority' => 34,
'choices' => array(
'min' => 100,
'max' => 900,
'step' => 100,
),
'output' => array(
'element' => 'h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6',
'property' => 'font-weight'
)
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_headers_size',
'label' => __( 'Font Size', 'maera_bs' ) . ' ' . __( 'Default: ', 'maera_bs' ) . '1',
'description' => __( 'The size defined here applies to H5. All other header elements are calculated porportionally, based on the base font size.', 'maera_bs' ),
'section' => 'typo_headers',
'default' => 1,
'priority' => 35,
'choices' => array(
'min' => 0.1,
'max' => 3,
'step' => 0.01,
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'font_headers_height',
'label' => __( 'Line Height', 'maera_bs' ) . ' ' . __( 'Default: ', 'maera_bs' ) . '1.1',
'section' => 'typo_headers',
'default' => 1.1,
'priority' => 36,
'choices' => array(
'min' => 0,
'max' => 3,
'step' => 0.1,
),
'output' => array(
'element' => 'h1,.h1,h2,.h2,h3,.h3,h4,.h4,h5,.h5,h6,.h6',
'property' => 'line-height'
)
);
return $controls;
}
function settings_blog_options( $controls ) {
$controls[] = array(
'type' => 'radio-buttonset',
'settings' => 'blog_post_mode',
'label' => __( 'Archives Display Mode', 'maera_bs' ),
'description' => __( 'Display the excerpt or the full post on post archives.', 'maera_bs' ),
'section' => 'blog_options',
'priority' => 1,
'default' => 'excerpt',
'choices' => array(
'excerpt' => __( 'Excerpt', 'maera_bs' ),
'full' => __( 'Full Post', 'maera_bs' ),
),
);
$controls[] = array(
'type' => 'sortable',
'settings' => 'maera_entry_meta_config',
'label' => __( 'Post Meta elements', 'maera_bs' ),
'help' => __( 'Click the "eye" to toggle the section from being displayed. Drag n Drop the "lines" to re-order. ', 'maera_zf' ),
'section' => 'blog_options',
'default' => array(
'date',
'author',
'comments'
),
'priority' => 2,
'choices' => array(
'author' => __( 'Author', 'maera_bs' ),
'sticky' => __( 'Sticky', 'maera_bs' ),
'date' => __( 'Date', 'maera_bs' ),
'category'=> __( 'Category', 'maera_bs' ),
'tags' => __( 'Tags', 'maera_bs' ),
'comments'=> __( 'Comments', 'maera_bs' ),
),
);
$controls[] = array(
'type' => 'checkbox',
'settings' => 'breadcrumbs',
'label' => __( 'Show Breadcrumbs. Please note that this setting requires you to save your options and refresh the page. Breadcrumbs are not displayed on the homepage.', 'maera_bs' ),
'section' => 'blog_options',
'priority' => 3,
'default' => 0,
);
$controls[] = array(
'type' => 'slider',
'settings' => 'post_excerpt_length',
'label' => __( 'Post excerpt length', 'maera_bs' ),
'description' => __( 'Choose how many words should be used for post excerpt. Default: 55', 'maera_bs' ),
'section' => 'blog_options',
'priority' => 10,
'default' => 55,
'choices' => array(
'min' => 10,
'max' => 150,
'step' => 1,
),
);
$controls[] = array(
'type' => 'text',
'settings' => 'post_excerpt_link_text',
'label' => __( '"more" text', 'maera_bs' ),
'subtitle' => __( 'Text to display in case of excerpt too long. Default: Continued', 'maera_bs' ),
'section' => 'blog_options',
'priority' => 12,
'default' => __( 'Continued', 'maera_bs' ),
);
return $controls;
}
function settings_feat_archive( $controls ) {
$controls[] = array(
'type' => 'checkbox',
'settings' => 'feat_img_archive',
'label' => __( 'Display Featured Images', 'maera_bs' ),
'description' => __( 'Display featured Images on post archives ( such as categories, tags, month view etc ).', 'maera_bs' ),
'section' => 'feat_archive',
'priority' => 50,
'default' => 0,
);
$controls[] = array(
'type' => 'slider',
'settings' => 'feat_img_archive_width',
'label' => __( 'Featured Image Width', 'maera_bs' ),
'subtitle' => __( 'Set to -1 for max width and 0 for original width. Default: -1', 'maera_bs' ),
'section' => 'feat_archive',
'priority' => 52,
'default' => -1,
'choices' => array(
'min' => -1,
'max' => get_theme_mod( 'screen_large_desktop', 1200 ),
'step' => '1'
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'feat_img_archive_height',
'label' => __( 'Featured Image Height', 'maera_bs' ),
'subtitle' => __( 'Set to 0 to resize the image using the original image proportions. Default: 0', 'maera_bs' ),
'section' => 'feat_archive',
'priority' => 53,
'default' => 0,
'choices' => array(
'min' => 0,
'max' => get_theme_mod( 'screen_large_desktop', 1200 ),
'step' => '1'
),
);
$post_types = get_post_types( array( 'public' => true ), 'names' );
$controls[] = array(
'type' => 'multicheck',
'mode' => 'checkbox',
'settings' => 'feat_img_per_post_type',
'label' => __( 'Disable featured images per post type.', 'maera_bs' ),
// 'subtitle' => __( 'CAUTION: This setting will also disable displaying the featured images on single posts as well.', 'maera_bs' ),
'section' => 'feat_archive',
'priority' => 65,
'default' => '',
'choices' => $post_types,
);
return $controls;
}
function settings_feat_single( $controls ) {
$controls[] = array(
'type' => 'checkbox',
'settings' => 'feat_img_post',
'label' => __( 'Display Featured Images', 'maera_bs' ),
'subtitle' => __( 'Display featured Images on single posts.', 'maera_bs' ),
'section' => 'feat_single',
'priority' => 60,
'default' => 0,
);
$controls[] = array(
'type' => 'slider',
'settings' => 'feat_img_post_width',
'label' => __( 'Featured Image Width', 'maera_bs' ),
'subtitle' => __( 'Set to -1 for max width and 0 for original width. Default: -1', 'maera_bs' ),
'section' => 'feat_single',
'priority' => 62,
'default' => -1,
'choices' => array(
'min' => -1,
'max' => get_theme_mod( 'screen_large_desktop', 1200 ),
'step' => '1'
),
);
$controls[] = array(
'type' => 'slider',
'settings' => 'feat_img_post_height',
'label' => __( 'Featured Image Height', 'maera_bs' ),
'subtitle' => __( 'Set to 0 to use the original image proportions. Default: 0', 'maera_bs' ),
'section' => 'feat_single',
'priority' => 63,
'default' => 0,
'choices' => array(
'min' => 0,
'max' => get_theme_mod( 'screen_large_desktop', 1200 ),
'step' => '1'
),
);
return $controls;
}
function settings_jumbo_bg( $controls ) {
$controls[] = array(
'type' => 'background',
'settings' => 'jumbo_bg',
'label' => __( 'Jumbotron Background', 'maera_bs' ),
'section' => 'jumbo_bg',
'default' => array(
'color' => '#eeeeee',
'image' => null,
'repeat' => 'repeat',
'size' => 'inherit',
'attach' => 'inherit',
'position' => 'left-top',
'opacity' => 100,
),
'priority' => 1,
'output' => '.jumbotron',
);
return $controls;
}
function settings_structure_jumbo( $controls ) {
$controls[] = array(
'type' => 'checkbox',
'settings' => 'jumbotron_nocontainer',
'label' => __( 'Full-Width', 'maera_bs' ),
'description' => __( 'When selected, the Jumbotron is no longer restricted by the width of your page, taking over the full width of your screen. This option is useful when you have assigned a slider widget on the Jumbotron area and you want its width to be the maximum width of the screen. Default: OFF.', 'maera_bs' ),
'section' => 'structure_jumbo',
'default' => 0,
'priority' => 11,
);