How to exclude one (or more) skin(s) when using the “Randomize the skin” option

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

Note: This snippet applies to Customizr(free) v3.4.9 (and above) and Customizr-Pro v1.2.6 (and above)

When using the “Randomize the skin” option you might want to exclude some skins to be taken in account.

Say you don’t like the grey based skins you can use the following code to exclude them.

add_filter('tc_skins_to_randomize', 'exclude_skins');
function exclude_skins( $_skins ){
  $_my_excluded = array(
    'grey.css',
    'grey2.css'
  );
  foreach ( $_my_excluded as $key )
    if ( array_key_exists( $key, $_skins ) )
      unset( $_skins[$key] );

  return $_skins;
}

As of now the available skins are:

black.css, black2.css, blue.css, blue2.css, blue3.css, green.css, gree2.css, grey.css, grey2.css, orange.css, orange2.css, purple.css, purple2.css, red.css, red2.css, yellow.css, yellow2.css

You can find them in your theme’s directory under inc/assets/css

or on the github theme repository.

Where to copy/paste this code?
Add it to your child-theme functions.php.
Everything you need to know about creating a child theme with Customizr here.

Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “How to exclude one (or more) skin(s) when using the “Randomize the skin” option”