Color Picker
-
Hello,
I’m working on creating more color pickers for my website and I successfully created a color picker that controlled the navigation text’s color. However, after the recent update, my work disappeared and when I wrote my code again, it stopped working. I’m currently editing the 2016 theme and I would love some insight to how to fix my issue.
This is the code that I created:
In color-scheme-control.js( function( api ) { var cssTemplate = wp.template( 'twentysixteen-color-scheme' ), colorSchemeKeys = [ 'menu_text_color' ], colorSettings = [ 'menu_text_color' ]; api.controlConstructor.select = api.Control.extend( { ready: function() { if ( 'color_scheme' === this.id ) { this.setting.bind( 'change', function( value ) { var colors = colorScheme[value].colors; // Update Header Menu Text Color. color = colors[5]; api( 'menu_text_color' ).set( color ); api.control( 'menu_text_color' ).container.find( '.color-picker-hex' ) .data( 'data-default-color', color ) .wpColorPicker( 'defaultColor', color ); } ); } } } );
________________________________________
in the customizer.phpreturn <<< CSS /* Menu Text Color */ .main-navigation a{ color: {$colors['menu_text_color']}; }
-
This topic was modified 9 months ago by
Steven Stern (sterndata). Reason: backticks
-
This topic was modified 9 months ago by
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Color Picker’ is closed to new replies.