Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Created December 23, 2013 03:31
Show Gist options
  • Save BeardedGinger/8091311 to your computer and use it in GitHub Desktop.
Save BeardedGinger/8091311 to your computer and use it in GitHub Desktop.
Set front-end styles for WooCommerce on theme activation
//* Set the default WooCommerce front-end styles
global $pagenow;
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' ) {
add_action( 'admin_init', 'woocommerce_default_frontend_styles' );
}
/**
* Define default WooCommerce frontend styles
*/
function woocommerce_default_frontend_styles() {
$colors = array(
'primary' => '#aaa',
'secondary' => '#888',
'highlight' => '#fc0000',
'content_bg' => '#111',
'subtext' => '#fff'
);
// Front-end Colors
update_option( 'woocommerce_frontend_css_colors', $colors );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment