Site logo

Archived topic

Issue Changing Default Color Palette

3 replies · Started by Shaun on May 20, 2020

Viewing posts 1–4 of 4

Hi

I'm fairly new to GP Pro and I need some help changing the default color palette. I am working on a new site, I've made it live so you can see it, but it has virtually no content.

I have already tried to change the default color palette using the code snippets plugin and the following code, which I based on the GP documentation generate_default_color_palettes, but the original colors still appear when I go to write a post or page etc.

I have attached an image showing my code (in snippets plugin) and an image of the unchanged default color palette.

The site has a caching program WP Rocket, but I have cleared the cache and then deactivated the plugin to no avail.

The code I used was:

add_filter( 'generate_default_color_palettes', 'tu_custom_color_palettes' );
function tu_custom_color_palettes( $palettes ) {
	$palettes = array(
		'#333333',
		'#FFFFFF',
		'#cc0000',
		'#3f0099',
		'#009999',
		'#99cccc',
		'#ccccff',
		'#ffcccc',
	);
	
	return $palettes;
} 

color code
null`

Thanks in advance

Hi David

Thanks for your prompt reply.

2 quick questions:

  1. Should I delete my earlier snippet?
  2. Should I use the same process? (snippets plugin)

Cheers
Shaun

1. You can keep your existing snippet as this controls the customizer colors.
2. Yes, Snippets plugin will do the job :)

This archived topic is closed to new replies.