[Support request] How to apply “real” global colorsfeature to GB & GP based site?

Home Forums Support How to apply “real” global colorsfeature to GB & GP based site?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1497389
    Sascha

    Hi,

    I have already tried to find similar posts here in forum as well as on FB, but the search-function of this forum is rather creating a chaos on my screen than showing a list of potentially relevant posts 😉

    So I have seen a reply by Tom where he provides a code snippet, that will alter the global-color-picker:

    add_action( 'after_setup_theme', function() {
        add_theme_support( 'editor-color-palette', array(
            array(
                'name'  => __( 'Blue' ),
                'slug'  => 'blue',
                'color' => '#59BACC',
            ),
            array(
                'name'  => __( 'Green' ),
                'slug'  => 'green',
                'color' => '#58AD69',
            ),
            array(
                'name'  => __( 'Orange' ),
                'slug'  => 'orange',
                'color' => '#FFBC49',
            ),
            array(
                'name'  => __( 'Red' ),
                'slug'  => 'red',
                'color' => '#E2574C',
            ),
        ) );
    } );

    I have applied this snippet to my site, “connected” the color “Blue” with some items,
    then altered the hex-code of “Blue” to a red tone, saved, and expected all those connected items to automatically switch to this red tone.

    Even with flushing all caches (server, browser etc.) the color of those with “Blue” connected items remained blue instead of red.

    Could you please tell me about how to use, or establish, a color-palette-system, that is truly updating all items connected with the palette?

    Thank you and kind regards,
    Sascha

    #1497407
    Leo
    Staff
    Customer Support

    Hi there,

    Can you first confirm that the code is added using one of the these methods?
    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #1500429
    Sascha

    yes, i use code snippets plugin

    #1500624
    Elvin
    Staff
    Customer Support

    Hi,

    I believe this is where you got the code from?
    https://generatepress.com/forums/topic/add-theme-support-editor-color-palette/

    If you look closely, Tom added , 50 );, w/c is execution priority, on the code.

    Can you try adding the priority arg value on your code as well? Let us know if it works.

    A wise man once said:
    "Have you cleared your cache?"

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