Support

Account

Home Forums Backend Issues (wp-admin) Getting values into add_theme_support()

Unread

Getting values into add_theme_support()

  • oops, I got my question marked as spam when I added html.
    Trying again:

    I have created an options page with a color picker. I am attempting to call the colors in functions.php in add_theme_support. The values from the options aren’t loading though. Is it too early? Any thoughts? Here’s my code:

    
    $bdn_color_palette = array();
    
    $bdn_color_palette[] = array(
    	'name' => 'Primary',
    	'slug' => 'primary',
    	'color' => esc_html( get_field('brand_colour_primary', 'option') ),
    );
    $bdn_color_palette[] = array(
    	'name' => 'Secondary',
    	'slug' => 'secondary',
    	'color' => esc_html( get_field('brand_colour_secondary', 'option') ),
    );
    
    add_theme_support( 'editor-color-palette', $bdn_color_palette );
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.