- This topic has 3 replies, 3 voices, and was last updated 5 years, 6 months ago by
Elvin.
-
AuthorPosts
-
October 20, 2020 at 10:00 am #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,
SaschaOctober 20, 2020 at 10:14 am #1497407Leo
StaffCustomer SupportHi 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/October 22, 2020 at 12:27 pm #1500429Sascha
yes, i use code snippets plugin
October 22, 2020 at 6:16 pm #1500624Elvin
StaffCustomer SupportHi,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.