This repository was archived by the owner on Jul 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcustomizer.php
More file actions
executable file
·91 lines (73 loc) · 2.79 KB
/
customizer.php
File metadata and controls
executable file
·91 lines (73 loc) · 2.79 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
<?php
// ------------- Theme Customizer ------------- //
add_action( 'customize_register', 'medium_customizer_register' );
function medium_customizer_register( $wp_customize ) {
class Medium_Customize_Textarea_Control extends WP_Customize_Control {
public $type = 'textarea';
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
<textarea rows="5" style="width:100%;" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>
</label>
<?php
}
}
//Style Options
$wp_customize->add_section( 'medium_customizer_basic', array(
'title' => __( 'Theme Options', 'medium' ),
'priority' => 1
) );
//Logo Image
$wp_customize->add_setting( 'medium_customizer_logo', array(
) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'medium_customizer_logo', array(
'label' => __( 'Logo Upload', 'medium' ),
'section' => 'medium_customizer_basic',
'settings' => 'medium_customizer_logo',
'priority' => 1
) ) );
//Accent Color
$wp_customize->add_setting( 'medium_customizer_accent', array(
'default' => '#3ac1e8'
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'medium_customizer_accent', array(
'label' => __( 'Accent Color', 'medium' ),
'section' => 'medium_customizer_basic',
'settings' => 'medium_customizer_accent'
) ) );
//Link Color
$wp_customize->add_setting( 'medium_customizer_link', array(
'default' => '#3ac1e8'
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'medium_customizer_link', array(
'label' => __( 'Link Color', 'medium' ),
'section' => 'medium_customizer_basic',
'settings' => 'medium_customizer_link'
) ) );
//Infinite Scroll
$wp_customize->add_setting( 'medium_customizer_infinite', array(
'default' => 'disabled',
'capability' => 'edit_theme_options',
'type' => 'option',
) );
$wp_customize->add_control( 'infinite_select_box', array(
'settings' => 'medium_customizer_infinite',
'label' => __( 'Infinite Scrolling', 'medium' ),
'section' => 'medium_customizer_basic',
'type' => 'select',
'choices' => array(
'enabled' => __( 'Enabled', 'medium' ),
'disabled' => __( 'Disabled', 'medium' )
),
) );
//Custom CSS
$wp_customize->add_setting( 'medium_customizer_css', array(
'default' => '',
) );
$wp_customize->add_control( new Medium_Customize_Textarea_Control( $wp_customize, 'medium_customizer_css', array(
'label' => __( 'Custom CSS', 'medium' ),
'section' => 'medium_customizer_basic',
'settings' => 'medium_customizer_css',
) ) );
}