[Support request] wp customizer

Home Forums Support [Support request] wp customizer

Home Forums Support wp customizer

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #637657
    Bart

    Hi,

    I’m customizing a generatepress child theme and I was wondering how it is possible to get the settings for the 4 basic colors ?

    for example : $wp_customize->get_setting( ‘header_textcolor’ )->default
    https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/get_setting

    Thx in advance,

    Bart

    #637946
    Leo
    Staff
    Customer Support

    Hi there,

    Would this filter help?
    https://docs.generatepress.com/article/generate_default_color_palettes/

    Let me know πŸ™‚

    #638003
    Bart

    Almost πŸ™‚

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

    Bart

    #638164
    Leo
    Staff
    Customer Support

    One of our staff suggested this might be what you are looking for:
    https://en-gb.wordpress.org/plugins/kt-tinymce-color-grid/

    Let us know πŸ™‚

    #638176
    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

    #638221
    Tom
    Lead Developer
    Lead Developer

    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'];
    #638360
    Bart

    Exact ! Thank you so much

    #638559
    Bart

    Worked like a charm …
    Thx again

    #638724
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad I could help πŸ™‚

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.