Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Having troube adding another color scheme to theme I'm using

Featured Replies

The wordpress theme I'm currently using only has four color scheme options to choose from. I'm trying to create another one by adding the necessary code into my style.css file. But for some reason it's not showing up as an option when I go to Appearance > theme options. It still only shows the original four options.

 

I can see the code for the other four color schemes. this code is for the blue color scheme. Each color scheme's code looks just like it:

/* =Blue
----------------------------------------------- */

.theme-color-blue {
    background-color: #86afbf;
}
.theme-color-blue .cat-links a,
.theme-color-blue .comments-link a,
.theme-color-blue .comments-link span,
.theme-color-blue .widget-title,
.theme-color-blue .main-navigation,
.theme-color-blue .entry-header,
.theme-color-blue th,
.theme-color-blue .menu-toggle {
    background-color: rgb(81,140,158);
}
.theme-color-blue .cat-links a:hover,
.theme-color-blue .comments-link a:hover,
.theme-color-blue .main-navigation ul ul li,
.theme-color-blue .main-navigation ul li.hover,
.theme-color-blue .main-navigation ul li:hover {
    background-color: rgba(81,140,158,.;
}

They each also have this additional code further down the style.css file:

.theme-color-blue.infinite-scroll #infinite-footer .container,
.theme-color-blue #infinite-handle span {
    background-color: rgba(81,140,158,.;
    border-color: #86afbf;
}

So I made another color scheme by copying and pasting the codes and replacing "blue" with "uglygreen". Also, everywhere it mentions the background-colors I replaced it with the new colors.

 

So the code I added to create a new color scheme option looks like this:

/* =UglyGreen
----------------------------------------------- */

.theme-color-uglygreen {
    background-color: #86afbf;
}
.theme-color-uglygreen.cat-links a,
.theme-color-uglygreen .comments-link a,
.theme-color-uglygreen .comments-link span,
.theme-color-uglygreen .widget-title,
.theme-color-uglygreen .main-navigation,
.theme-color-uglygreen .entry-header,
.theme-color-uglygreen th,
.theme-color-uglygreen .menu-toggle {
    background-color: rgb(140,117,54);
}
.theme-color-uglygreen .cat-links a:hover,
.theme-color-uglygreen .comments-link a:hover,
.theme-color-uglygreen .main-navigation ul ul li,
.theme-color-uglygreen .main-navigation ul li.hover,
.theme-color-uglygreen .main-navigation ul li:hover {
    background-color: rgba(140,117,54,.;
}

and this:

.theme-color-uglygreen.infinite-scroll #infinite-footer .container,
.theme-color-uglygreen #infinite-handle span {
    background-color: rgba(140,117,54,.;
    border-color: #86afbf;

Any idea why it's not listing my new color scheme as an option in "theme options"?

 

 

 

It's because wordpress doesn't know about the new colour scheme. There will be a set of functions in the theme files that manages and displays the colour schemes. It could be in functions.php or the admin files or maybe header.php. It's impossible to know without knowing which theme your are using.

  • Author

It does mention the color scheme options in functions.php, so I added the code for my new color scheme there as well:

 

$options = babylog_get_theme_options();
$colorscheme = $options['color_scheme'];

if ( isset( $colorscheme ) && ! empty( $colorscheme ) ) {
if ( 'green' == $colorscheme )
$backgroundcolor = 'c2e2bf';
else if ( 'blue' == $colorscheme )
$backgroundcolor = '86afbf';
else if ( 'pink' == $colorscheme )
$backgroundcolor = 'e29393';
else if ( 'purple' == $colorscheme )
$backgroundcolor = 'bfa1c6';
else if ( 'uglygreen' == $colorscheme )
$backgroundcolor = '63a89b';
}

 

But, it still isn't giving me the option to choose the new color scheme. I used my browser search tool to search all the other theme files for "color" and I don't see anything else that seem relevant.

 

What do you mean by "admin files"?

Functions.php manages the output. There will be another file somewhere that manages the theme options. It could be the customiser, a settings file or something else. Each theme does it differently.

 

What's the theme?

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.