• jewelsco18

    (@jewelsco18)



    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.php

    return <<< CSS
    	/* Menu Text Color */
    	.main-navigation a{
    		color: {$colors['menu_text_color']}; 
    	}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.