Theme Activated

function first_run_options() {
$check = get_option('theme_name_activation_check');

if ( $check != "set" ) {
// DO INITIALISATION STUFF

// Add marker so it doesn't run in future
add_option('theme_name_activation_check', "set");
}
}
add_action('wp_head', 'first_run_option');

function delete_stuff() {
delete_option('theme_name_activation_check');
}

add_action('switch_theme', 'delete_stuff');

0 Comments

You must be logged in to post a comment.