Site logo

Archived topic

Global fonts - functions.php

3 replies · Started by Alfiniti on May 29, 2022

Viewing posts 1–4 of 4

I'm using this code:

/* Changes the Global Colros in GP */
add_filter( 'option_generate_settings', function( $settings ) {
$settings['global_colors'] = [
[
'name' => __( 'Contrast', 'generatepress' ),
'slug' => 'contrast',
'color' => '#000000',
],
[
'name' => sprintf( __( 'Base', 'generatepress' ), '2' ),
'slug' => 'base',
'color' => '#ffffff',
],

// And so on..
];

return $settings;
} );

In the past, I had no problem with this but, today I can't get my global colors to take.

Do you have any idea what bone-head mistake I'm making?

Hi there,

if you're using the latest version of the theme, then that code won't work and is not required, as you can set your own Global Colors directly in the Customizer > Colors now

ohhhhhhhhhhhhhhhhhhhhhhhhhh!

Thanks!

You're welcome

This archived topic is closed to new replies.