Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. $wp_customize->add_control( 'custom_theme_css', array(
  2. 'type' => 'date',
  3. 'priority' => 10, // Within the section.
  4. 'section' => 'colors', // Required, core or custom.
  5. 'label' => __( 'Date' ),
  6. 'description' => __( 'This is a date control with a red border.' ),
  7. 'input_attrs' => array(
  8. 'class' => 'my-custom-class-for-js',
  9. 'style' => 'border: 1px solid #900',
  10. 'placeholder' => __( 'mm/dd/yyyy' ),
  11. ),
  12. 'active_callback' => 'is_front_page',
  13. 'section' => 'custom_css',
  14. ));
  15.  
  16. $wp_customize->add_control( 'custom_theme_css', array(
  17. 'label' => __( 'Custom Theme CSS' ),
  18. 'type' => 'textarea',
  19. 'section' => 'custom_css',
  20. ));
  21.  
  22. $wp_customize->add_control( 'custom_theme_css', array(
  23. 'label' => __( 'Change Opacity' ),
  24. 'type' => 'css',
  25. 'opacity' => ''//some variable that gets user input for opacity value
  26. 'section' => 'color',
  27. ));
  28.  
  29. $wp_customize->add_control( 'custom_theme_css', array(
  30. 'label' => __( 'Set CSS Opacity Value' ),
  31. 'type' => 'text',
  32. 'section' => 'custom_css',
  33. ) );
  34.  
  35. $wp_customize->add_control(
  36. 'my_control',
  37. array(
  38. 'label' => __( 'Opacity Control', 'mytheme' ),
  39. 'section' => 'my_section',
  40. 'settings' => 'my_setting',
  41. 'type' => 'text',
  42. )
  43. );
  44.  
  45. <head>
  46. <style>
  47. *{
  48. opacity: <?php echo get_theme_mod( 'my_control', '0' ); ?>
  49. }
  50. </style>
  51. </head>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement