- This topic has 8 replies, 4 voices, and was last updated 1 year, 7 months ago by
Leo.
-
AuthorPosts
-
April 30, 2019 at 7:25 am #884412
Silvio
Hi,
I added this code in the function.php of my child theme (blank, just installed)
add_filter( 'generate_default_color_palettes', 'tu_custom_color_palettes' ); function tu_custom_color_palettes( $palettes ) { $palettes = array( '#000000', '#FFFFFF', '#20ec73', '#575757', '#222222', '#1e72bd', '#8E44AD', '#00CC77', ); return $palettes; }
But I can’t see custom color codes in my palette.
April 30, 2019 at 9:11 am #884569Tom
Lead DeveloperLead DeveloperThat looks good – those colors aren’t showing up in the Customizer when you open a color picker?
Can you try this?:
add_action( 'wp', function() { add_filter( 'generate_default_color_palettes', function() { return array( '#000000', '#FFFFFF', '#20ec73', '#575757', '#222222', '#1e72bd', '#8E44AD', '#00CC77', ); } ); } );
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 30, 2019 at 9:23 am #884585Silvio
yes, colors in the customizer didn’t change. and unfortunately, neither trying with the code you posted.
I am running it on MAMP, and I even have tried to stop and restart the servers. And change the browser from Chrome to Safari.
April 30, 2019 at 1:39 pm #884807Silvio
additionally, I created a clean installation in MAMP with the last version of everything, and no one of this codes works π
April 30, 2019 at 1:41 pm #884810Tom
Lead DeveloperLead DeveloperI just tried the first function you shared and here’s what I see: http://prntscr.com/nivzu9
Looks like it’s working?
How are you adding the function?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 30, 2019 at 5:08 pm #884969Silvio
are you using MAMP?
I just copy and pasted the function in the function.php of the child theme
May 1, 2019 at 8:17 am #885696Tom
Lead DeveloperLead DeveloperI’m using XAMPP, but it shouldn’t matter. Any other servers/sites you can test on?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 12, 2019 at 4:00 am #1007498Klaus
First solution by Silvio worked fine for me. Thx Klaus
September 12, 2019 at 8:15 am #1007854Leo
StaffCustomer SupportGlad you’ve found the post π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.