• Resolved mstarks01

    (@mstarks01)


    Hiya,

    I’m trying to modify an array. In the following array in functions.php, I added a line to the end and created a snippet from this. I thought it would override the array in functions.php but I must be misunderstanding how it works. Any tips appreciated.

    //* Add support for additional color style options
    add_theme_support( ‘genesis-style-selector’, array(
    ‘enterprise-pro-black’ => __( ‘Enterprise Pro Black’, ‘enterprise’ ),
    ‘enterprise-pro-green’ => __( ‘Enterprise Pro Green’, ‘enterprise’ ),
    ‘enterprise-pro-orange’ => __( ‘Enterprise Pro Orange’, ‘enterprise’ ),
    ‘enterprise-pro-red’ => __( ‘Enterprise Pro Red’, ‘enterprise’ ),
    ‘enterprise-pro-teal’ => __( ‘Enterprise Pro Teal’, ‘enterprise’ ),
    ‘enterprise-pro-teal’ => __( ‘Enterprise Pro Teal’, ‘enterprise’ ),
    ‘custom-color’ => __( ‘ISSA Fort Worth’, ‘enterprise’ ),
    ) );

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    You’re on the right track, but you’ll need to wrap it in an action hook so the theme does not override it.

    
    
    add_action( 'after_setup_theme', function () {
    
    	add_theme_support( 'genesis-style-selector', array(
    		'enterprise-pro-black' => __( 'Enterprise Pro Black', 'enterprise' ),
    		'enterprise-pro-green' => __( 'Enterprise Pro Green', 'enterprise' ),
    		'enterprise-pro-orange' => __( 'Enterprise Pro Orange', 'enterprise' ),
    		'enterprise-pro-red' => __( 'Enterprise Pro Red', 'enterprise' ),
    		'enterprise-pro-teal' => __( 'Enterprise Pro Teal', 'enterprise' ),
    		'enterprise-pro-teal' => __( 'Enterprise Pro Teal', 'enterprise' ),
    		'custom-color' => __( 'ISSA Fort Worth', 'enterprise' ),
    	) );
    
    }, 999 );
    Thread Starter mstarks01

    (@mstarks01)

    Thanks, Shea. Much appreciated.

    Plugin Author Shea Bunge

    (@bungeshea)

    Glad you could get it working ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modifying an Array’ is closed to new replies.