Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $wp_customize->add_control( 'custom_theme_css', array(
- 'type' => 'date',
- 'priority' => 10, // Within the section.
- 'section' => 'colors', // Required, core or custom.
- 'label' => __( 'Date' ),
- 'description' => __( 'This is a date control with a red border.' ),
- 'input_attrs' => array(
- 'class' => 'my-custom-class-for-js',
- 'style' => 'border: 1px solid #900',
- 'placeholder' => __( 'mm/dd/yyyy' ),
- ),
- 'active_callback' => 'is_front_page',
- 'section' => 'custom_css',
- ));
- $wp_customize->add_control( 'custom_theme_css', array(
- 'label' => __( 'Custom Theme CSS' ),
- 'type' => 'textarea',
- 'section' => 'custom_css',
- ));
- $wp_customize->add_control( 'custom_theme_css', array(
- 'label' => __( 'Change Opacity' ),
- 'type' => 'css',
- 'opacity' => ''//some variable that gets user input for opacity value
- 'section' => 'color',
- ));
- $wp_customize->add_control( 'custom_theme_css', array(
- 'label' => __( 'Set CSS Opacity Value' ),
- 'type' => 'text',
- 'section' => 'custom_css',
- ) );
- $wp_customize->add_control(
- 'my_control',
- array(
- 'label' => __( 'Opacity Control', 'mytheme' ),
- 'section' => 'my_section',
- 'settings' => 'my_setting',
- 'type' => 'text',
- )
- );
- <head>
- <style>
- *{
- opacity: <?php echo get_theme_mod( 'my_control', '0' ); ?>
- }
- </style>
- </head>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement