Skip to content

Instantly share code, notes, and snippets.

@dannymichel
Created October 6, 2012 05:31
Show Gist options
  • Select an option

  • Save dannymichel/3844035 to your computer and use it in GitHub Desktop.

Select an option

Save dannymichel/3844035 to your computer and use it in GitHub Desktop.
function var_slide_color(){
$black = get_post_meta($post->ID, 'black', true);
$white = get_post_meta($post->ID, 'white', true);
wp_register_style( 'white', get_template_directory_uri() . '/white.css');
wp_register_style( 'white', get_template_directory_uri() . '/black.css');
if ($white) {
wp_enqueue_style('white');
echo get_post_meta($post->ID, 'white', true);
}
elseif ($black)
wp_enqueue_style('white');
echo get_post_meta($post->ID, 'black', true);
}
add_action('wp_enqueue_scripts', 'var_slide_color');
add_post_meta($white, 'name', 'value');
add_post_meta($black, 'vane', 'value');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment