• Resolved Ivan Lutrov

    (@ivanlutrov)


    I’m uncertain whether this is by design but I don’t think so.

    As far as I can see, all the theme settings colour related hex values are stored with a leading #, like these examples:

    [page_font_color] => #282828
    [button_text_color] => #1e73be
    [menu_logo_color] => #282828
    [page_accent_color] => #1e73be

    However, the background_color hex value is stored without a leading #, like this example:

    [background_color] => f8f8f8

    I’m coding some dynamic CSS generation stuff and I know how to cater for this anomaly but it would be nice if it were fixed.

    • This topic was modified 4 years, 9 months ago by Ivan Lutrov.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author David Vongries

    (@davidvongries)

    Hi @ivanlutrov,

    the background color settings aren’t technically coming from the theme.

    they’re defined by WordPress core and enabled by adding theme support like this:

    // Custom background.
    add_theme_support(
    	'custom-background',
    	array(
    		'default-color'      => 'ffffff',
    		'default-image'      => '',
    		'default-repeat'     => 'repeat',
    		'default-position-x' => 'left',
    		'default-position-y' => 'top',
    		'default-size'       => 'auto',
    		'default-attachment' => 'scroll',
    	)
    );

    Also, the output is handled by WordPress core so things may be a bit different for the background-color options than for the options we have registered in the customizer.

    Hope that helps ??

    Best,
    David

    Thread Starter Ivan Lutrov

    (@ivanlutrov)

    Yep, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Theme settings colour values’ is closed to new replies.