Site logo

Archived topic

wp customizer

8 replies · Started by Bart on August 1, 2018

Viewing posts 1–9 of 9

Almost :-)

I would need the colors selected in the customizer, not change them programmatically ...

Bart

With all respect, but that is not at all what I'm asking.

You are storing the main colors of the theme (setup through the customizer) in the mysql database. Probably serialised.

With I need is a function to retrieve these colors in an array so I can use in in a dynmaically generated css file.

Please show him/her my exact phrase above....

Bart

Hey Bart,

These colors?: https://github.com/tomusborne/generatepress/blob/2.1.3/inc/defaults.php#L47-L50

If so, try this:

$settings = wp_parse_args(
    get_option( 'generate_settings', array() ),
    generate_get_defaults()
);

// Background color.
$settings['background_color'];

// Text color.
$settings['text_color'];

// Link color.
$settings['link_color'];

// Link color hover.
$settings['link_color_hover'];

Exact ! Thank you so much

Worked like a charm ...
Thx again

Awesome, glad I could help :)

This archived topic is closed to new replies.